forked from VerySleepy/verysleepy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.iss
121 lines (99 loc) · 4.94 KB
/
installer.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
; Very Sleepy install script, for Inno Setup
[Setup]
AppName=Very Sleepy
AppVersion=0.82
; AppId is used to identify the program in the registry.
AppId=Very Sleepy
AppPublisher=codersnotes.com
AppPublisherURL=http://www.codersnotes.com
AppSupportURL=http://www.codersnotes.com
AppUpdatesURL=http://www.codersnotes.com
DefaultDirName={pf}\Very Sleepy
DefaultGroupName=Very Sleepy
AllowNoIcons=yes
LicenseFile=license.rtf
OutputBaseFilename=setup
SetupIconFile=src\sleepy.ico
Compression=lzma
SolidCompression=yes
OutputDir=.
ArchitecturesInstallIn64BitMode=x64
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
; 32-bit version
Source: "obj\Win32\Release\sleepy.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "src\crashback\bin\Win32\Release\crashreport.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "dbghelp_x86\dbghelp.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "dbghelp_x86\dbghelpw.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "dbghelp_x86\symsrv.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "dbghelp_x86\srcsrv.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "dbghelp_x86\symsrv.yes"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
; 64-bit version
Source: "obj\x64\Release\sleepy.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "src\crashback\bin\x64\Release\crashreport.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x64\dbghelp.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x64\dbghelpw.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x64\dbghelpw_wow64.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x64\symsrv.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x64\srcsrv.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x64\symsrv.yes"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
; 32-bit version for 64-bit systems
Source: "obj\Win32\Release\sleepy.exe"; DestDir: "{app}\32"; DestName: "sleepy.exe"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x86\dbghelp.dll"; DestDir: "{app}\32"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x86\dbghelpw.dll"; DestDir: "{app}\32"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x86\symsrv.dll"; DestDir: "{app}\32"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x86\srcsrv.dll"; DestDir: "{app}\32"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "dbghelp_x86\symsrv.yes"; DestDir: "{app}\32"; Flags: ignoreversion; Check: Is64BitInstallMode
; Other bits
Source: "keywords.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "license.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "osfunctions.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "osmodules.txt"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\Very Sleepy"; Filename: "{app}\sleepy.exe"
Name: "{group}\Very Sleepy (32-bit)"; Filename: "{app}\32\sleepy.exe"; Check: Is64BitInstallMode
[Run]
Filename: "{app}\sleepy.exe"; Description: "{cm:LaunchProgram,Very Sleepy}"; Flags: nowait postinstall skipifsilent
[Code]
const
MsiDir = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{49CCD620-07C3-48B3-9B53-D1E104DC47D0}';
MsiUninstall = '/uninstall {49CCD620-07C3-48B3-9B53-D1E104DC47D0} /passive';
var
MsiExists: Boolean;
MsiPage: TInputOptionWizardPage;
procedure InitializeWizard();
begin
MsiExists := False;
// Prompt to remove version 0.6 if it exists
if RegKeyExists( HKLM, MsiDir ) then
begin
MsiExists := True;
MsiPage := CreateInputOptionPage(wpWelcome,
'Previous Version', 'An older version was detected.',
'Would you like to first remove the older version of Very Sleepy?',
True, False);
MsiPage.Add('Uninstall the older version first.');
MsiPage.Add('Leave it where it is.');
MsiPage.Values[0] := True;
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
ResultCode: Integer;
begin
Result := True;
// Remove the old version right here, before we prompt to pick a new directory.
if MsiExists then
begin
if (CurPageID = MsiPage.ID) and (MsiPage.Values[0]) then
begin
if not Exec('MsiExec.exe', MsiUninstall, '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('The previous version could not be uninstalled. Please uninstall it manually.', mbError, MB_OK);
Result := False;
end;
end;
end;
end;