Das wäre eine Möglichkeit:
Delphi-Quellcode:
#define MyAppName "Inno User Setup"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "ich"
#define MyAppExeName "Test.exe"
#define MyAppContact "ich"
#define MyAppCopyright "2010"
#define MyAppComments "Nur ein Test"
#define MyAppID "C5F1D397-9695-9999-8B4E-3D9A5EE25619"
#define MyAppMutex "InnoSetupTest"
#include AddBackslash(CompilerPath) + "Lib\Uninstall.iss"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={userappdata}\{#MyAppPublisher}\{#MyAppName}
DisableDirPage=true
DefaultGroupName={#MyAppPublisher}\{#MyAppName}
DisableProgramGroupPage=true
OutputDir=Setup
OutputBaseFilename={#MyAppPublisher} {#MyAppName} {#MyAppVersion} InnoSetup
Compression=lzma/ultra64
SolidCompression=true
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoCopyright=©{#MyAppCopyright}
AppVersion={#MyAppVersion}
;{code:GetFileVersion|{#MyAppExeName}}
UsePreviousLanguage=no
AppID={{{#MyAppID}-{code:GetUserName|}}
AppContact={#MyAppContact}
UninstallDisplayIcon={app}\{#MyAppExeName}
UninstallDisplayName={#MyAppPublisher} {#MyAppName} {#MyAppVersion} {code:GetUserName|}
WindowVisible=false
BackColor=$8cffff
AppCopyright=©{#MyAppCopyright}
AppComments={#MyAppComments}
InternalCompressLevel=ultra64
VersionInfoDescription={#MyAppComments}
AppMutex={#MyAppMutex}_{code:GetUserName|}
[Languages]
Name: german; MessagesFile: compiler:Languages\German.isl
[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: *.txt; DestDir: {app}
[Icons]
Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; WorkingDir: {app}
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
UninstallOldVersion( '{{#MyAppID}-' + GetUserNameString + '}', true, true );
end;
function GetUserName( bla : string ) : string;
begin
RESULT := GetUserNameString;
end;
function GetFileVersion( Filename : string ): String;
begin
if not GetVersionNumbersString( Filename, RESULT ) then
RESULT := '';
end;
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ea 0a 4c 14 0d b6 3a a4 c1 c5 b9
dc 90 9d f0 e9 de 13 da 60)