Added InnoSetup PreProcessor (ISPP) requirement.

Added bunch of macros to make configuration changes less error prone.
Added ability to detect previous install directory entries in the registry.
Searches for entry in HKLM and HKCU sections.
Tidied-up some of the functions.
This commit is contained in:
John Popplewell 2005-07-27 20:26:46 +00:00
parent 8703213479
commit d67643c1ae

View file

@ -1,16 +1,41 @@
;
; This script needs the InnoSetup PreProcessor (ISPP) to compile correctly.
; I downloaded a combined 'QuickStart Pack' from here:
; http://www.jrsoftware.org/isdl.php#qsp
;
; The version string is extracted from the executable.
;
#define PublisherName "New Breed Software"
#define PublisherURL "http://www.newbreedsoftware.com/tuxpaint/"
#define AppName "Tux Paint"
#define AppDirName "TuxPaint"
#define AppPrefix "tuxpaint"
#define AppGroupName AppName
#define AppExe AppPrefix+".exe"
#define AppConfigName AppName+" Config"
#define AppConfigExe AppPrefix+"-config.exe"
#define AppReadme "docs\html\README.html"
#define AppLicence "docs\COPYING.txt"
#define BdistDir ".\bdist"
#define AppVersion GetStringFileInfo(BdistDir+"\"+AppExe, "FileVersion")
[Setup] [Setup]
AppName=Tux Paint AppName={#AppName}
AppVerName=Tux Paint 0.9.15-cvs AppVerName={#AppName} {#AppVersion}
AppPublisher=New Breed Software AppPublisher={#PublisherName}
AppPublisherURL=http://www.newbreedsoftware.com/tuxpaint/ AppPublisherURL={#PublisherURL}
AppSupportURL=http://www.newbreedsoftware.com/tuxpaint/ AppSupportURL={#PublisherURL}
AppUpdatesURL=http://www.newbreedsoftware.com/tuxpaint/ AppUpdatesURL={#PublisherURL}
DefaultDirName={pf}\TuxPaint DefaultDirName={pf}\{#AppDirName}
DefaultGroupName=Tux Paint DefaultGroupName={#AppGroupName}
LicenseFile=.\bdist\docs\COPYING.txt LicenseFile={#BdistDir}\{#AppLicence}
OutputDir=.\ OutputDir=.\
OutputBaseFilename=tuxpaint-0.9.15-cvs-win32-installer OutputBaseFilename={#AppPrefix}-{#AppVersion}-win32-installer
SetupIconFile=.\bdist\data\images\icon-win32.ico SetupIconFile={#BdistDir}\data\images\icon-win32.ico
Compression=lzma Compression=lzma
SolidCompression=yes SolidCompression=yes
@ -35,43 +60,43 @@ Name: "slo"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files] [Files]
Source: ".\bdist\tuxpaint.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\tuxpaint.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bdist\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bdist\libintl-3.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\libintl-3.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bdist\libpng12.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\libpng12.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bdist\SDL.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\SDL.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bdist\SDL_image.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\SDL_image.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bdist\SDL_mixer.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\SDL_mixer.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bdist\SDL_ttf.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\SDL_ttf.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bdist\data\*"; DestDir: "{app}\data"; Excludes: "CVS"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "{#BdistDir}\data\*"; DestDir: "{app}\data"; Excludes: "CVS"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bdist\docs\*"; DestDir: "{app}\docs"; Excludes: "CVS"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "{#BdistDir}\docs\*"; DestDir: "{app}\docs"; Excludes: "CVS"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bdist\locale\*"; DestDir: "{app}\locale"; Excludes: "CVS"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "{#BdistDir}\locale\*"; DestDir: "{app}\locale"; Excludes: "CVS"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bdist\tuxpaint-config.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BdistDir}\tuxpaint-config.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[INI] [INI]
Filename: "{app}\tuxpaint.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.newbreedsoftware.com/tuxpaint/" Filename: "{app}\{#AppName}.url"; Section: "InternetShortcut"; Key: "URL"; String: "{#PublisherURL}"
[Icons] [Icons]
Name: "{code:MyGroupDir}\Configure Tux Paint"; Filename: "{app}\tuxpaint-config.exe"; Comment: "Tux Paint Config" Name: "{code:MyGroupDir}\{#AppGroupName}\Configure {#AppName}"; Filename: "{app}\{#AppConfigExe}"; Comment: "{#AppConfigName}"
Name: "{code:MyGroupDir}\Tux Paint (Full Screen)"; Filename: "{app}\tuxpaint.exe"; Parameters: "--fullscreen"; Comment: "Start Tux Paint in Fullscreen mode" Name: "{code:MyGroupDir}\{#AppGroupName}\{#AppName} (Full Screen)"; Filename: "{app}\{#AppExe}"; Parameters: "--fullscreen"; Comment: "Start {#AppName} in Fullscreen mode"
Name: "{code:MyGroupDir}\Tux Paint (Windowed)"; Filename: "{app}\tuxpaint.exe"; Parameters: "--windowed"; Comment: "Start Tux Paint in a Window" Name: "{code:MyGroupDir}\{#AppGroupName}\{#AppName} (Windowed)"; Filename: "{app}\{#AppExe}"; Parameters: "--windowed"; Comment: "Start {#AppName} in a Window"
Name: "{code:MyGroupDir}\Readme"; Filename: "{app}\docs\html\README.html"; Comment: "View ReadMe" Name: "{code:MyGroupDir}\{#AppGroupName}\Readme"; Filename: "{app}\{#AppReadme}"; Comment: "View ReadMe"
Name: "{code:MyGroupDir}\Licence"; Filename: "{app}\docs\copying.txt"; Comment: "View License" Name: "{code:MyGroupDir}\{#AppGroupName}\Licence"; Filename: "{app}\{#AppLicence}"; Comment: "View License"
Name: "{code:MyGroupDir}\{cm:ProgramOnTheWeb,Tux Paint}"; Filename: "{app}\tuxpaint.url"; Comment: "{cm:ProgramOnTheWeb,Tux Paint}" Name: "{code:MyGroupDir}\{#AppGroupName}\{cm:ProgramOnTheWeb,{#AppName}}"; Filename: "{app}\{#AppName}.url"; Comment: "{cm:ProgramOnTheWeb,{#AppName}}"
Name: "{code:MyGroupDir}\{cm:UninstallProgram,Tux Paint}"; Filename: "{uninstallexe}"; IconFilename: "{app}\data\images\tuxpaint-installer.ico"; Comment: "Remove Tux Paint" Name: "{code:MyGroupDir}\{#AppGroupName}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"; IconFilename: "{app}\data\images\tuxpaint-installer.ico"; Comment: "Remove {#AppName}"
Name: "{code:MyDesktopDir}\Tux Paint"; Filename: "{app}\tuxpaint.exe"; Tasks: desktopicon Name: "{code:MyDesktopDir}\{#AppName}"; Filename: "{app}\{#AppExe}"; Tasks: desktopicon
[Registry] [Registry]
Root: HKLM; Subkey: "SOFTWARE\TuxPaint"; Flags: uninsdeletekey; ValueName: "Install_Dir"; ValueType: string; ValueData: "{app}"; Check: AllUsers; Root: HKLM; Subkey: "SOFTWARE\{#AppDirName}"; Flags: uninsdeletekey; ValueName: "Install_Dir"; ValueType: string; ValueData: "{app}"; Check: AllUsers;
Root: HKCU; Subkey: "SOFTWARE\TuxPaint"; Flags: uninsdeletekey; ValueName: "Install_Dir"; ValueType: string; ValueData: "{app}"; Check: ThisUserOnly; Root: HKCU; Subkey: "SOFTWARE\{#AppDirName}"; Flags: uninsdeletekey; ValueName: "Install_Dir"; ValueType: string; ValueData: "{app}"; Check: ThisUserOnly;
[Run] [Run]
Filename: "{app}\docs\html\README.html"; Description: "View the README file"; Flags: postinstall shellexec Filename: "{app}\{#AppReadme}"; Description: "View the README file"; Flags: postinstall shellexec
Filename: "{app}\tuxpaint-config.exe"; Description: "{cm:LaunchProgram,Tux Paint Config}"; Flags: nowait postinstall skipifsilent Filename: "{app}\{#AppConfigExe}"; Description: "{cm:LaunchProgram,{#AppConfigName}}"; Flags: nowait postinstall skipifsilent
[UninstallDelete] [UninstallDelete]
Type: files; Name: "{app}\tuxpaint.url" Type: files; Name: "{app}\{#AppName}.url"
[code] [code]
const const
@ -113,15 +138,19 @@ function MyAppDir(): String;
var var
Path: String; Path: String;
begin begin
Path := ExpandConstant('{pf}') Path := ExpandConstant('{reg:HKLM\SOFTWARE\{#AppDirName},Install_Dir|{pf}\{#AppDirName}}');
if ThisUserOnly() then if ThisUserOnly() then
begin begin
Path := GetShellFolderByCSIDL(CSIDL_PROFILE, True); Path := ExpandConstant('{reg:HKCU\SOFTWARE\{#AppDirName},Install_Dir|__MissingKey__}');
if Path = '' then if Path = '__MissingKey__' then
Path := RemoveBackslashUnlessRoot(ExtractFilePath(ExpandConstant('{userdocs}'))); begin
Path := Path + '\Programs' Path := GetShellFolderByCSIDL(CSIDL_PROFILE, True);
if Path = '' then
Path := RemoveBackslashUnlessRoot(ExtractFilePath(ExpandConstant('{userdocs}')));
Path := Path + '\Programs\{#AppDirName}'
end
end end
Result := Path + '\TuxPaint' Result := Path
end; end;
function MyGroupDir(Default: String): String; function MyGroupDir(Default: String): String;
@ -131,10 +160,8 @@ begin
if ThisUserOnly() then if ThisUserOnly() then
Path := ExpandConstant('{userprograms}') Path := ExpandConstant('{userprograms}')
else else
begin
Path := ExpandConstant('{commonprograms}') Path := ExpandConstant('{commonprograms}')
end Result := Path
Result := Path + '\Tux Paint'
end; end;
function MyDesktopDir(Default: String): String; function MyDesktopDir(Default: String): String;
@ -144,9 +171,7 @@ begin
if ThisUserOnly() then if ThisUserOnly() then
Path := ExpandConstant('{userdesktop}') Path := ExpandConstant('{userdesktop}')
else else
begin
Path := ExpandConstant('{commondesktop}') Path := ExpandConstant('{commondesktop}')
end
Result := Path Result := Path
end; end;
@ -185,4 +210,5 @@ begin
CreateTheWizardPages; CreateTheWizardPages;
end; end;
#expr SaveToFile(AddBackslash(SourcePath) + "Preprocessed.iss")