forked from miaupaw/instant-eyedropper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeinstaller.iss
119 lines (93 loc) · 4.31 KB
/
makeinstaller.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
#define appname 'Instant Eyedropper'
#define exename 'InstantEyedropper'
#define appversion GetFileVersion('vsproject/output/InstantEyedropper.exe')
#define productversion GetStringFileInfo('vsproject/output/InstantEyedropper.exe', "ProductVersion")
[Setup]
AppName = {#appname}
AppVerName = {#appname} {#appversion}
AppPublisher = Spicebrains
AppPublisherURL = http://www.instant-eyedropper.com/
DefaultDirName = {pf}\InstantEyedropper
DefaultGroupName = Instant Eyedropper
WindowVisible = no
Compression = lzma/ultra
SolidCompression = true
OutputDir = /
OutputBaseFilename = instant-eyedropper-{#productversion}
LicenseFile = {#SourcePath}vsproject\output\license.txt
UninstallDisplayIcon = {app}\InstantEyedropper.exe
DisableWelcomePage = no
DisableDirPage = no
DisableProgramGroupPage = yes
DisableReadyPage = yes
[Languages]
Name: en; MessagesFile: compiler:Default.isl
[Tasks]
Name: desktopicon; Description: "Create a &Desktop icon"; GroupDescription: "Additional icons:";
Name: quicklaunchicon; Description: "Create a &Quick Launch icon"; GroupDescription: "Additional icons:";
Name: autolaunch; Description: "Launch on Windows startup"; GroupDescription: "Options:";
[Registry]
Root: HKCU; SubKey: SOFTWARE\SpiceBrains; ValueType: string; ValueName: AppPath; ValueData: {app}
Root: HKCU; SubKey: SOFTWARE\SpiceBrains; ValueType: string; ValueName: exePath; ValueData: {app}\InstantEyedropper.exe
[Files]
Source: "{#SourcePath}vsproject\output\InstantEyedropper.exe"; DestDir: "{app}"; Flags: ignoreversion comparetimestamp
Source: "{#SourcePath}vsproject\output\license.txt"; DestDir: "{app}"
Source: "{#SourcePath}vsproject\output\readme.txt"; DestDir: "{app}"
Source: "{#SourcePath}vsproject\output\website.url"; DestDir: "{app}"; AfterInstall: SetAutoLaunch()
[Icons]
Name: {group}\Instant Eyedropper; Filename: {app}\InstantEyedropper.exe; WorkingDir: {app};
Name: {group}\Instant Eyedropper Readme; Filename: {app}\readme.txt; WorkingDir: {app};
Name: {group}\Visit Instant Eyedropper Home; Filename: {app}\website.url; WorkingDir: {app};
Name: {group}\uninstall; Filename: {uninstallexe};
Name: {userdesktop}\Instant Eyedropper; Filename: {app}\InstantEyedropper.exe; WorkingDir: {app}; MinVersion: 4,4; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Instant Eyedropper; Filename: {app}\InstantEyedropper.exe; WorkingDir: {app}; Tasks: quicklaunchicon;
[Code]
procedure InitializeWizard();
begin
// ìåíÿåò ñòðàíèöó ëèöåíçèè
WizardForm.LicenseAcceptedRadio.Checked := true;
WizardForm.LicenseAcceptedRadio.Hide;
WizardForm.LicenseNotAcceptedRadio.Hide;
WizardForm.LicenseMemo.Height := ScaleY(190);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
// ìåíÿåò òåêñò íà êíîïêàõ â çàâèñèìîñòè îò òåêóùåé ñòðàíèöû
if CurPageID = wpLicense then
WizardForm.NextButton.Caption := 'I Agree'
else if CurPageID = wpSelectTasks then
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
else if CurPageID = wpFinished then
WizardForm.NextButton.Caption := SetupMessage(msgButtonFinish)
else
WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
end;
procedure SetAutoLaunch();
begin
if IsTaskSelected('autolaunch') then
begin
RegWriteStringValue(HKEY_CURRENT_USER,
'Software\Microsoft\Windows\CurrentVersion\Run\',
'instanteyedropper',
'"' + ExpandConstant('{app}') + '\InstantEyedropper.exe"');
end;
end;
[Run]
Filename: "{app}\InstantEyedropper.exe"; Description: "Launch Instant Eyedropper"; Flags: postinstall nowait skipifsilent
[Code]
const WM_CLOSE = $0010;
function InitializeSetup(): Boolean;
var Wnd: HWND;
begin
Wnd := FindWindowByClassName('ed_winlass');
if Wnd <> 0 then SendMessage(Wnd, WM_CLOSE, 0, 0);
Result := True;
end;
function InitializeUninstall(): Boolean;
// var ErrorCode: Integer;
var Wnd: HWND;
begin
Wnd := FindWindowByClassName('ed_winlass');
if Wnd <> 0 then SendMessage(Wnd, WM_CLOSE, 0, 0);
result := True;
end;