title: InnoSetup - Shortcut Icon on desktop corrupted
body: <p>Shortcuts from start menu and allprograms dir are fine but on the desktop shortcut is completely blank/corrupted?</p>
  
  <pre><code>#define MyAppName "MyAppName "
  #define MyAppVersion "1"
  #define MyAppPublisher "MyAppName"
  #define MyAppURL "http://www.MyAppName.com/"
  #define MyAppExeName "MyAppName.exe"
  
  
  [Setup]
  ; NOTE: The value of AppId uniquely identifies this application.
  ; Do not use the same AppId value in installers for other applications.
  ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  AppId=***
  AppName={#MyAppName}
  AppVersion={#MyAppVersion}
  ;AppVerName={#MyAppName} {#MyAppVersion}
  AppPublisher={#MyAppPublisher}
  AppPublisherURL={#MyAppURL}
  AppSupportURL={#MyAppURL}
  AppUpdatesURL={#MyAppURL}
  DefaultDirName={pf}\{#MyAppName}
  DefaultGroupName={#MyAppName}
  OutputDir=C:\***\{#MyAppVersion}
  OutputBaseFilename=myapp_{#MyAppVersion}
  Compression=lzma
  SolidCompression=yes
  
  [Languages]
  Name: "english"; MessagesFile: "compiler:Default.isl"
  
  [Tasks]
  Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
  Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
  
  [Files]
  Source: "C:\***.exe"; DestDir: "{app}"; Flags: ignoreversion
  Source: "C:\***\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
  Source: "***\bin\vcredist_x86.exe"; DestDir: {app}\bin\;
  ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  
  [Icons]
  Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" 
  Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}" 
  Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
  Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
  Name: "{group}\Manual"; Filename: "{app}\Manual.pdf"
  
  
  [Run]
  Filename: {app}\bin\vcredist_x86.exe; Parameters: "/q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; WorkingDir: {app}\bin; StatusMsg: Installing Visual Studio 2010 C++ CRT Libraries...
  Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&amp;', '&amp;&amp;')}}"; Flags: nowait postinstall skipifsilent
  
  [Code]
  /////////////////////////////////////////////////////////////////////
  function GetUninstallString(): String;
  var
    sUnInstPath: String;
    sUnInstallString: String;
  begin
    sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
    sUnInstallString := '';
    if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
      RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
    Result := sUnInstallString;
  end;
  
  
  /////////////////////////////////////////////////////////////////////
  function IsUpgrade(): Boolean;
  begin
    Result := (GetUninstallString() &lt;&gt; '');
  end;
  
  
  /////////////////////////////////////////////////////////////////////
  function UnInstallOldVersion(): Integer;
  var
    sUnInstallString: String;
    iResultCode: Integer;
  begin
  // Return Values:
  // 1 - uninstall string is empty
  // 2 - error executing the UnInstallString
  // 3 - successfully executed the UnInstallString
  
    // default return value
    Result := 0;
  
    // get the uninstall string of the old app
    sUnInstallString := GetUninstallString();
    if sUnInstallString &lt;&gt; '' then begin
      sUnInstallString := RemoveQuotes(sUnInstallString);
      if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
        Result := 3
      else
        Result := 2;
    end else
      Result := 1;
  end;
  
  /////////////////////////////////////////////////////////////////////
  procedure CurStepChanged(CurStep: TSetupStep);
  begin
    if (CurStep=ssInstall) then
    begin
      if (IsUpgrade()) then
      begin
        UnInstallOldVersion();
      end;
    end;
  end;
  </code></pre>