forked from WikidPad/WikidPad
/
wikidpad_unicode.iss
327 lines (289 loc) · 15.9 KB
/
wikidpad_unicode.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
[Files]
Source: dist\WikidPad.exe; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\appbase.css; DestDir: {app}
Source: WikidPad\extensions\*.py; DestDir: {app}\extensions\; Flags: recursesubdirs ignoreversion
Source: WikidPad\extensions\*.pyf; DestDir: {app}\extensions\; Flags: recursesubdirs ignoreversion
Source: WikidPad\extensions\*.zipf; DestDir: {app}\extensions\; Flags: recursesubdirs ignoreversion
Source: dist\icons\*.gif; DestDir: {app}\icons\; Flags: onlyifdoesntexist
Source: dist\icons\pwiki.ico; DestDir: {app}\icons\; Flags: onlyifdoesntexist
Source: dist\WikidPadHelp\*; DestDir: {app}\WikidPadHelp\; Flags: recursesubdirs ignoreversion
Source: dist\license.txt; DestDir: {app}
Source: dist\python34.dll; DestDir: {app}
Source: dist\sqlite3.dll; DestDir: {app}
Source: dist\wxbase30u_net_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\wxbase30u_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\wxbase30u_xml_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\wxmsw30u_adv_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\wxmsw30u_core_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\wxmsw30u_html_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\wxmsw30u_stc_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\wxmsw30u_webview_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\wxmsw30u_xrc_vc100.dll; DestDir: {app}; Check: ShouldInstallWxRuntime
Source: dist\_bz2.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_ctypes.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_decimal.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_hashlib.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_lzma.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_multiprocessing.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_socket.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_sqlite3.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_ssl.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\_winxptheme.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\pyexpat.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\select.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\unicodedata.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\wx._adv.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx._core.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx._grid.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx._html.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx._html2.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx._msw.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx._stc.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx._xml.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx._xrc.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\wx.siplib.pyd; DestDir: {app}; Flags: replacesameversion ignoreversion; Check: ShouldInstallWxRuntime
Source: dist\WikidPad.xrc; DestDir: {app}
Source: dist\WikidPad_*.po; DestDir: {app}; Flags: ignoreversion sortfilesbyextension
Source: dist\langlist.txt; DestDir: {app}; Flags: replacesameversion ignoreversion
Source: dist\library.zip; DestDir: {app}; Flags: nocompression
Source: WikidPad\docs\MenuHandling_contextInfo.txt; DestDir: {app}\docs\; Flags: recursesubdirs ignoreversion
Source: WikidPad-winport.config; DestDir: {app}; DestName: WikidPad.config; Flags: onlyifdoesntexist; Check: PortableInstall
Source: winBinAdditions\msvcp100.dll; DestDir: {app}
Source: winBinAdditions\msvcr100.dll; DestDir: {app}
[Dirs]
Name: {app}\extensions
Name: {app}\icons
Name: {app}\WikidPadHelp
Name: {app}\WikidPadHelp\data
Name: {app}\WikidPadHelp\files
Name: {app}\export
[Setup]
#define verStr "2.4alpha01"
#define verNo "002.004.001.000"
SolidCompression=true
AppName=WikidPad
AppVerName=WikidPad {#verStr}
DefaultDirName={pf}\WikidPad
DefaultGroupName=WikidPad
AppID={{892B75BE-D97F-4F9B-8A15-F729D1FB672A}
VersionInfoVersion={#verNo}
VersionInfoTextVersion=WikidPad {#verStr}
LicenseFile=dist\license.txt
AllowNoIcons=true
ShowLanguageDialog=yes
Compression=lzma/ultra
OutputBaseFilename=WikidPad-{#verStr}
InternalCompressLevel=ultra
AppCopyright=© 2005-2018 Michael Butscher, Jason Horman, Gerhard Reitmayr
UsePreviousAppDir=true
PrivilegesRequired=none
CreateUninstallRegKey=not PortableInstall
Uninstallable=not PortableInstall
[INI]
Filename: {app}\binInst.ini; Section: Main; Key: CurrVersion; String: {#verNo}; Flags: createkeyifdoesntexist uninsdeleteentry uninsdeletesectionifempty
Filename: {app}\binInst.ini; Section: Main; Key: wxVersion; String: 002.008.010.001; Flags: createkeyifdoesntexist uninsdeleteentry uninsdeletesectionifempty; Check: ShouldInstallWxRuntime
Filename: {app}\binInst.ini; Section: Main; Key: portableInstall; String: 0; Flags: uninsdeleteentry uninsdeletesectionifempty; Check: not PortableInstall
Filename: {app}\binInst.ini; Section: Main; Key: portableInstall; String: 1; Flags: uninsdeleteentry uninsdeletesectionifempty; Check: PortableInstall
[Icons]
Name: {code:IconDest|Dummy}\WikidPad; Filename: {app}\WikidPad.exe; IconFilename: {app}\icons\pwiki.ico; IconIndex: 0; Check: not PortableInstall
Name: {code:IconDest|Dummy}\{cm:UninstallProgram, WikidPad}; Filename: {uninstallexe}; Check: not PortableInstall
[Registry]
Root: HKCR; SubKey: .wiki; ValueType: string; ValueData: wikidPadFile; Flags: uninsdeletekey; Tasks: assocWiki; Check: GlobalRegClasses
Root: HKCR; SubKey: wikidPadFile; ValueType: string; ValueData: WikidPad File; Flags: uninsdeletekey; Tasks: assocWiki; Check: GlobalRegClasses
Root: HKCR; SubKey: wikidPadFile\Shell\Open\Command; ValueType: string; ValueData: """{app}\WikidPad.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: assocWiki; Check: GlobalRegClasses
Root: HKCR; Subkey: wikidPadFile\DefaultIcon; ValueType: string; ValueData: {app}\icons\pwiki.ico,0; Flags: uninsdeletevalue; Tasks: assocWiki; Check: GlobalRegClasses
Root: HKCR; Subkey: wiki; ValueType: string; ValueData: URL:WikidPad Protocol; Flags: uninsdeletekey; Tasks: assocWikiUrl; Check: GlobalRegClasses
Root: HKCR; Subkey: wiki; ValueType: string; ValueName: URL Protocol; Flags: uninsdeletevalue; Tasks: assocWikiUrl; Check: GlobalRegClasses
Root: HKCR; Subkey: wiki\shell; ValueType: string; ValueData: open; Flags: uninsdeletevalue; Tasks: assocWikiUrl; Check: GlobalRegClasses
Root: HKCR; Subkey: wiki\DefaultIcon; ValueType: string; ValueData: {app}\icons\pwiki.ico,0; Flags: uninsdeletevalue; Tasks: assocWikiUrl; Check: GlobalRegClasses
Root: HKCR; Subkey: wiki\shell\open\command; ValueType: string; ValueData: """{app}\WikidPad.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: assocWikiUrl; Check: GlobalRegClasses
Root: HKCU; Subkey: Software\Classes\.wiki; ValueType: string; ValueData: wikidPadFile; Flags: uninsdeletekey; Check: UserRegClasses
Root: HKCU; SubKey: Software\Classes\wikidPadFile; ValueType: string; ValueData: WikidPad File; Flags: uninsdeletekey; Tasks: assocWiki; Check: UserRegClasses
Root: HKCU; SubKey: Software\Classes\wikidPadFile\Shell\Open\Command; ValueType: string; ValueData: """{app}\WikidPad.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: assocWiki; Check: UserRegClasses
Root: HKCU; Subkey: Software\Classes\wikidPadFile\DefaultIcon; ValueType: string; ValueData: {app}\icons\pwiki.ico,0; Flags: uninsdeletevalue; Tasks: assocWiki; Check: UserRegClasses
Root: HKCU; Subkey: Software\Classes\wiki; ValueType: string; ValueData: URL:WikidPad Protocol; Flags: uninsdeletekey; Tasks: assocWikiUrl; Check: UserRegClasses
Root: HKCU; Subkey: Software\Classes\wiki; ValueType: string; ValueName: URL Protocol; Flags: uninsdeletevalue; Tasks: assocWikiUrl; Check: UserRegClasses
Root: HKCU; Subkey: Software\Classes\wiki\shell; ValueType: string; ValueData: open; Flags: uninsdeletevalue; Tasks: assocWikiUrl; Check: UserRegClasses
Root: HKCU; Subkey: Software\Classes\wiki\DefaultIcon; ValueType: string; ValueData: {app}\icons\pwiki.ico,0; Flags: uninsdeletevalue; Tasks: assocWikiUrl; Check: UserRegClasses
Root: HKCU; Subkey: Software\Classes\wiki\shell\open\command; ValueType: string; ValueData: """{app}\WikidPad.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: assocWikiUrl; Check: UserRegClasses
[Tasks]
Name: assocWiki; Description: Associate WikidPad with .wiki files; Check: not PortableInstall
Name: assocWikiUrl; Description: "Handle URLs with ""wiki:"" by WikidPad"; Check: not PortableInstall
[InstallDelete]
Name: {app}\regexpr.cache; Type: files
Name: {app}\zlib.pyd; Type: files
Name: {app}\extensions\WikiSyntax.py; Type: files
Name: {app}\gadfly.zip; Type: files
Name: {app}\python26.dll; Type: files
Name: {app}\readme_Wic.txt; Type: files
Name: {app}\wx._aui.pyd; Type: files
Name: {app}\wx._controls_.pyd; Type: files
Name: {app}\wx._core_.pyd; Type: files
Name: {app}\wx._gdi_.pyd; Type: files
Name: {app}\wx._misc_.pyd; Type: files
Name: {app}\wx._windows_.pyd; Type: files
Name: {app}\wxbase28uh_net_vc.dll; Type: files
Name: {app}\wxbase28uh_vc.dll; Type: files
Name: {app}\wxbase28uh_xml_vc.dll; Type: files
Name: {app}\wxmsw28uh_adv_vc.dll; Type: files
Name: {app}\wxmsw28uh_aui_vc.dll; Type: files
Name: {app}\wxmsw28uh_core_vc.dll; Type: files
Name: {app}\wxmsw28uh_html_vc.dll; Type: files
Name: {app}\wxmsw28uh_stc_vc.dll; Type: files
Name: {app}\wxmsw28uh_xrc_vc.dll; Type: files
Name: {app}\WikidPadHelp\data\wikidb.gfd; Type: files
Name: {app}\WikidPadHelp\data\*.grl; Type: files
Name: {app}\WikidPadHelp\data\index; Type: filesandordirs
[UninstallDelete]
Name: {app}\regexpr.cache; Type: files
Name: {app}\binInst.ini; Type: files
Name: {app}\WikidPad_*.xrc; Type: files
Name: {app}\extensions\*.pyc; Type: filesandordirs
Name: {app}\extensions\*.pyo; Type: filesandordirs
Name: {app}\extensions\__pycache__; Type: filesandordirs
Name: {app}\extensions\wikidPadParser\*.pyc; Type: filesandordirs
Name: {app}\extensions\wikidPadParser\*.pyo; Type: filesandordirs
Name: {app}\extensions\wikidPadParser\__pycache__; Type: filesandordirs
Name: {app}\extensions\mediaWikiParser\*.pyc; Type: filesandordirs
Name: {app}\extensions\mediaWikiParser\*.pyo; Type: filesandordirs
Name: {app}\extensions\mediaWikiParser\__pycache__; Type: filesandordirs
[Run]
Filename: {app}\WikidPad.exe; WorkingDir: {app}; Description: Start WikidPad; Flags: postinstall skipifsilent nowait
[LangOptions]
LanguageID=$0000
[Code]
var
PortableModeQuestion: TInputOptionWizardPage;
UserModeQuestion: TInputOptionWizardPage;
NotAdminMessage: TOutputMsgWizardPage;
function PortableInstall: Boolean;
begin
result := PortableModeQuestion.SelectedValueIndex = 1
end;
function ShouldAskForUsermode: Boolean;
begin
result := UsingWinNT and IsAdminLoggedOn;
end;
procedure InitializeWizard;
begin
PortableModeQuestion := CreateInputOptionPage(wpLicense,
'Portable installation?',
'Install in portable mode, e.g. on a USB stick (to uninstall, just delete the created folder)',
'',
True, False);
PortableModeQuestion.Add('Standard installation');
PortableModeQuestion.Add('Portable installation (no uninstaller, no file associations)');
PortableModeQuestion.SelectedValueIndex := 0;
if ShouldAskForUsermode then begin
UserModeQuestion := CreateInputOptionPage(PortableModeQuestion.ID,
'Installation mode',
'You install as admin, choose for whom you want to install',
'Install WikidPad for',
True, False);
UserModeQuestion.Add('All Users');
UserModeQuestion.Add('Current User');
UserModeQuestion.SelectedValueIndex := 0;
end
else if UsingWinNT then begin
NotAdminMessage := CreateOutputMsgPage(PortableModeQuestion.ID,
'Not in admin mode', 'You should install as admin',
'This program can be installed for all users if you run it as administrator. ' +
'You can now abort the setup and log in as administrator.'#13#13 +
'If you cannot or don''t want to do that, you can just continue and install ' +
'it for current user only.'#13#13 +
'If you continue, be aware that the installer maybe can''t ' +
'install in the suggested default directory. You may receive an ' +
'error message if you try that.');
end
end;
function IsUserModePage(PageID: Integer): Boolean;
begin
if ShouldAskForUsermode then begin
result := UserModeQuestion.ID = PageID;
end
else if UsingWinNT then
result := NotAdminMessage.ID = PageID;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if PortableInstall then begin
result := IsUserModePage(PageID) or (PageID = wpSelectProgramGroup);
end
else
result := false;
end;
function IconDest(Param: String): String;
begin
if ShouldAskForUsermode() and (UserModeQuestion.SelectedValueIndex = 0) then
// All users
Result := ExpandConstant('{commonprograms}\{groupname}')
else
// Current user
Result := ExpandConstant('{userprograms}\{groupname}');
end;
function GlobalRegClasses: Boolean;
// Returns true iff registry entries should go to global HK_CR root.
// If false, they go to HK_CU\Software\Classes (or nowhere in portable mode)
begin
if PortableInstall then begin
Result := false;
exit;
end;
if ShouldAskForUsermode() and (UserModeQuestion.SelectedValueIndex = 0) then
Result := true
else
Result := not UsingWinNT; // On Win 98/ME, it should always return true
end;
function UserRegClasses: Boolean;
// Returns true iff registry entries should go to HK_CU\Software\Classes
begin
if PortableInstall then begin
Result := false;
exit;
end;
Result := not GlobalRegClasses;
end;
function ShouldInstallWxRuntime: Boolean;
// Returns true iff wxWidgets runtime should be installed.
begin
Result := true;
// Result := not GetIniBool('PreventInstall', 'wxPy2_8_10_1', false,
// ExpandConstant('{app}\binInst.ini'));
end;
function MemoAppend(Memo, NewContent, NewLine: String): String;
begin
if NewContent <> '' then
result := Memo + NewContent + NewLine + NewLine
else
result := Memo;
end;
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
Answer: String;
begin
Answer := '';
Answer := MemoAppend(Answer, MemoUserInfoInfo, NewLine);
Answer := MemoAppend(Answer, MemoDirInfo, NewLine);
Answer := MemoAppend(Answer, MemoTypeInfo, NewLine);
Answer := MemoAppend(Answer, MemoComponentsInfo, NewLine);
if not PortableInstall then
Answer := MemoAppend(Answer, MemoGroupInfo, NewLine);
Answer := MemoAppend(Answer, MemoTasksInfo, NewLine);
Result := Answer;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
resultCode: Integer;
begin
// Call our function just before the actual uninstall process begins
if CurUninstallStep = usUninstall then
begin
if MsgBox('Do you also want to remove your personal settings?',
mbConfirmation, MB_YESNO) = idYes then
begin
Exec(ExpandConstant('{app}/WikidPad.exe'), '--deleteconfig',
ExpandConstant('{app}'), SW_HIDE, ewWaitUntilTerminated, resultCode);
end;
end;
end;