2012-02-06 8 views
3

Les raccourcis du menu Démarrer et du répertoire allprograms sont corrects, mais sur le bureau, le raccourci est complètement vide/corrompu?InnoSetup - Icône de raccourci sur le bureau corrompu

#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, '&', '&&')}}"; 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() <> ''); 
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 <> '' 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; 
+0

Je me demande vraiment pourquoi cette question downvoted, peut-être le spectateur qui l'a fait pourrait-il éclairer moi – Marko29

+0

Peut-être qu'il cherchait plus de détails, comme le code de script qui crée le raccourci corrompu. Demander cela est une meilleure façon de l'obtenir plutôt que de faire des downvotes. –

+0

il est plus productif de suggérer que, merci Brad Stowers – Marko29

Répondre

0

Il semble cette question était l'icône qui était 16x16 et 32x32 seulement, au-dessus qui montre bien sur le bureau utilisait win7

Questions connexes