forked from openlp/openlp
142 lines
5.9 KiB
Plaintext
142 lines
5.9 KiB
Plaintext
; Script generated by the Inno Setup Script Wizard.
|
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
|
|
|
#define AppName "OpenLP"
|
|
#define AppVerName "OpenLP 2.0"
|
|
#define AppPublisher "OpenLP Developers"
|
|
#define AppURL "http://openlp.org/"
|
|
#define AppExeName "OpenLP.exe"
|
|
|
|
#define FileHandle FileOpen("..\..\dist\OpenLP\.version")
|
|
#define FileLine FileRead(FileHandle)
|
|
#define RealVersion FileLine
|
|
#expr FileClose(FileHandle)
|
|
|
|
[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={{AA7699FA-B2D2-43F4-8A70-D497D03C9485}
|
|
AppName={#AppName}
|
|
AppVerName={#AppVerName}
|
|
AppPublisher={#AppPublisher}
|
|
AppPublisherURL={#AppURL}
|
|
AppSupportURL={#AppURL}
|
|
AppUpdatesURL={#AppURL}
|
|
DefaultDirName={pf}\{#AppName}
|
|
DefaultGroupName={#AppVerName}
|
|
AllowNoIcons=true
|
|
LicenseFile=LICENSE.txt
|
|
OutputDir=..\..\dist
|
|
OutputBaseFilename=OpenLP-{#RealVersion}-setup
|
|
Compression=lzma
|
|
SolidCompression=true
|
|
SetupIconFile=C:\Program Files\Inno Setup 5\Examples\Setup.ico
|
|
WizardImageFile=C:\Program Files\Inno Setup 5\WizModernImage-IS.bmp
|
|
WizardSmallImageFile=C:\Program Files\Inno Setup 5\WizModernSmallImage-IS.bmp
|
|
|
|
[Languages]
|
|
Name: english; MessagesFile: compiler:Default.isl
|
|
Name: basque; MessagesFile: compiler:Languages\Basque.isl
|
|
Name: brazilianportuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
|
|
Name: catalan; MessagesFile: compiler:Languages\Catalan.isl
|
|
Name: czech; MessagesFile: compiler:Languages\Czech.isl
|
|
Name: danish; MessagesFile: compiler:Languages\Danish.isl
|
|
Name: dutch; MessagesFile: compiler:Languages\Dutch.isl
|
|
Name: finnish; MessagesFile: compiler:Languages\Finnish.isl
|
|
Name: french; MessagesFile: compiler:Languages\French.isl
|
|
Name: german; MessagesFile: compiler:Languages\German.isl
|
|
Name: hebrew; MessagesFile: compiler:Languages\Hebrew.isl
|
|
Name: hungarian; MessagesFile: compiler:Languages\Hungarian.isl
|
|
Name: italian; MessagesFile: compiler:Languages\Italian.isl
|
|
Name: japanese; MessagesFile: compiler:Languages\Japanese.isl
|
|
Name: norwegian; MessagesFile: compiler:Languages\Norwegian.isl
|
|
Name: polish; MessagesFile: compiler:Languages\Polish.isl
|
|
Name: portuguese; MessagesFile: compiler:Languages\Portuguese.isl
|
|
Name: russian; MessagesFile: compiler:Languages\Russian.isl
|
|
Name: slovak; MessagesFile: compiler:Languages\Slovak.isl
|
|
Name: slovenian; MessagesFile: compiler:Languages\Slovenian.isl
|
|
Name: spanish; MessagesFile: compiler:Languages\Spanish.isl
|
|
|
|
[Tasks]
|
|
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}
|
|
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}
|
|
|
|
[Files]
|
|
Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
|
|
|
[Icons]
|
|
Name: {group}\{#AppName}; Filename: {app}\{#AppExeName}
|
|
Name: {group}\{#AppName} (Debug); Filename: {app}\{#AppExeName}; Parameters: -l debug
|
|
Name: {group}\{cm:ProgramOnTheWeb,{#AppName}}; Filename: {#AppURL}
|
|
Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe}
|
|
Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExeName}; Tasks: desktopicon
|
|
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\{#AppExeName}; Tasks: quicklaunchicon
|
|
|
|
[Run]
|
|
Filename: {app}\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent
|
|
|
|
[Registry]
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\alerts; ValueType: dword; ValueName: status; ValueData: $00000001
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\bibles; ValueType: dword; ValueName: status; ValueData: $00000001
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\custom; ValueType: dword; ValueName: status; ValueData: $00000001
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\images; ValueType: dword; ValueName: status; ValueData: $00000001
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\media; ValueType: dword; ValueName: status; ValueData: $00000001
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\presentations; ValueType: dword; ValueName: status; ValueData: $00000001
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\remotes; ValueType: dword; ValueName: status; ValueData: $00000000
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\songs; ValueType: dword; ValueName: status; ValueData: $00000001
|
|
Root: HKCU; SubKey: Software\OpenLP\OpenLP\songusage; ValueType: dword; ValueName: status; ValueData: $00000001
|
|
|
|
[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;
|
|
|
|
// Return Values:
|
|
// 1 - uninstall string is empty
|
|
// 2 - error executing the UnInstallString
|
|
// 3 - successfully executed the UnInstallString
|
|
function UnInstallOldVersion(): Integer;
|
|
var
|
|
sUnInstallString: String;
|
|
iResultCode: Integer;
|
|
begin
|
|
Result := 0;
|
|
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;
|