Browse Source

Windows Bundle, Version 1

Claudio Luck 1 year ago
commit
7ba32b01a9
No account linked to committer's email address
85 changed files with 7604 additions and 0 deletions
  1. BIN
      Windows/Enigmail+pEp_Bundle.exe
  2. 490
    0
      Windows/Enigmail+pEp_Bundle.nsi
  3. 38
    0
      Windows/NSIS/Contrib/ExecDos/ExecDos.sln
  4. 461
    0
      Windows/NSIS/Contrib/ExecDos/ExecDos.vcxproj
  5. 44
    0
      Windows/NSIS/Contrib/ExecDos/ExecDos.vcxproj.filters
  6. 83
    0
      Windows/NSIS/Contrib/ExecDos/api.h
  7. 40
    0
      Windows/NSIS/Contrib/ExecDos/consApp.cpp
  8. 91
    0
      Windows/NSIS/Contrib/ExecDos/consApp.dsp
  9. 508
    0
      Windows/NSIS/Contrib/ExecDos/execDos.c
  10. BIN
      Windows/NSIS/Contrib/ExecDos/execDos.rc
  11. 229
    0
      Windows/NSIS/Contrib/ExecDos/nsis_tchar.h
  12. 294
    0
      Windows/NSIS/Contrib/ExecDos/pluginapi.c
  13. 104
    0
      Windows/NSIS/Contrib/ExecDos/pluginapi.h
  14. 14
    0
      Windows/NSIS/Contrib/ExecDos/resource.h
  15. 2
    0
      Windows/NSIS/Contrib/Inetc/afxres.h
  16. 83
    0
      Windows/NSIS/Contrib/Inetc/api.h
  17. 105
    0
      Windows/NSIS/Contrib/Inetc/crt.cpp
  18. 1731
    0
      Windows/NSIS/Contrib/Inetc/inetc.cpp
  19. 199
    0
      Windows/NSIS/Contrib/Inetc/inetc.rc
  20. 42
    0
      Windows/NSIS/Contrib/Inetc/inetc.sln
  21. 441
    0
      Windows/NSIS/Contrib/Inetc/inetc.vcxproj
  22. 52
    0
      Windows/NSIS/Contrib/Inetc/inetc.vcxproj.filters
  23. 229
    0
      Windows/NSIS/Contrib/Inetc/nsis_tchar.h
  24. 294
    0
      Windows/NSIS/Contrib/Inetc/pluginapi.c
  25. 104
    0
      Windows/NSIS/Contrib/Inetc/pluginapi.h
  26. 47
    0
      Windows/NSIS/Contrib/Inetc/resource.h
  27. 58
    0
      Windows/NSIS/Docs/ExecDos/Readme.txt
  28. 153
    0
      Windows/NSIS/Docs/Inetc/Readme.htm
  29. 161
    0
      Windows/NSIS/Docs/Inetc/wiki.txt
  30. 19
    0
      Windows/NSIS/Examples/ExecDos/Batch.nsi
  31. 47
    0
      Windows/NSIS/Examples/ExecDos/Detailed.nsi
  32. 78
    0
      Windows/NSIS/Examples/ExecDos/Example.nsi
  33. 63
    0
      Windows/NSIS/Examples/ExecDos/IsDone.nsi
  34. 25
    0
      Windows/NSIS/Examples/ExecDos/Multi.nsi
  35. 55
    0
      Windows/NSIS/Examples/ExecDos/ToFunc.nsi
  36. 61
    0
      Windows/NSIS/Examples/ExecDos/ToStack.nsi
  37. 125
    0
      Windows/NSIS/Examples/ExecDos/ToWindow.nsi
  38. BIN
      Windows/NSIS/Examples/ExecDos/consApp.exe
  39. 6
    0
      Windows/NSIS/Examples/ExecDos/first.bat
  40. 11
    0
      Windows/NSIS/Examples/ExecDos/listbox.ini
  41. 11
    0
      Windows/NSIS/Examples/ExecDos/ml_edit.ini
  42. 3
    0
      Windows/NSIS/Examples/ExecDos/second.bat
  43. 54
    0
      Windows/NSIS/Examples/Inetc/Example.nsi
  44. 32
    0
      Windows/NSIS/Examples/Inetc/auth_dlg.nsi
  45. 32
    0
      Windows/NSIS/Examples/Inetc/ftp_auth.nsi
  46. 30
    0
      Windows/NSIS/Examples/Inetc/head.nsi
  47. 32
    0
      Windows/NSIS/Examples/Inetc/headers.nsi
  48. 7
    0
      Windows/NSIS/Examples/Inetc/headers.php
  49. 27
    0
      Windows/NSIS/Examples/Inetc/https.nsi
  50. 81
    0
      Windows/NSIS/Examples/Inetc/inetc_local.nsi
  51. 31
    0
      Windows/NSIS/Examples/Inetc/post.nsi
  52. 13
    0
      Windows/NSIS/Examples/Inetc/post.php
  53. 31
    0
      Windows/NSIS/Examples/Inetc/post_file.nsi
  54. 10
    0
      Windows/NSIS/Examples/Inetc/post_file.php
  55. 18
    0
      Windows/NSIS/Examples/Inetc/post_form.html
  56. 31
    0
      Windows/NSIS/Examples/Inetc/put.nsi
  57. 19
    0
      Windows/NSIS/Examples/Inetc/put.php
  58. 65
    0
      Windows/NSIS/Examples/Inetc/recursive.nsi
  59. 31
    0
      Windows/NSIS/Examples/Inetc/redirect.nsi
  60. 6
    0
      Windows/NSIS/Examples/Inetc/redirect.php
  61. 32
    0
      Windows/NSIS/Examples/Inetc/timeout.nsi
  62. 32
    0
      Windows/NSIS/Examples/Inetc/tostack.nsi
  63. 33
    0
      Windows/NSIS/Examples/Inetc/translate.nsi
  64. BIN
      Windows/NSIS/ExecDos.zip
  65. BIN
      Windows/NSIS/Inetc.zip
  66. BIN
      Windows/NSIS/Plugins/amd64-unicode/INetC.dll
  67. BIN
      Windows/NSIS/Plugins/x64-ansi/ExecDos.dll
  68. BIN
      Windows/NSIS/Plugins/x64-unicode/ExecDos.dll
  69. BIN
      Windows/NSIS/Plugins/x86-ansi/ExecDos.dll
  70. BIN
      Windows/NSIS/Plugins/x86-ansi/INetC.dll
  71. BIN
      Windows/NSIS/Plugins/x86-unicode/ExecDos.dll
  72. BIN
      Windows/NSIS/Plugins/x86-unicode/INetC.dll
  73. BIN
      Windows/enigmail-2.0.7.xpi
  74. 122
    0
      Windows/getProfile.bat
  75. 1
    0
      Windows/gpa-pep.conf
  76. 1
    0
      Windows/gpg-agent-pep.conf
  77. 1
    0
      Windows/gpg-pep.conf
  78. 19
    0
      Windows/gpg4win.ini
  79. 2
    0
      Windows/gpg4win_setup.bat
  80. BIN
      Windows/held.bmp
  81. BIN
      Windows/held.png
  82. BIN
      Windows/if_User_No-Frame_97832.ico
  83. 136
    0
      Windows/install.bat
  84. 12
    0
      Windows/installSettings.bat
  85. 62
    0
      Windows/staged.json

BIN
Windows/Enigmail+pEp_Bundle.exe View File


+ 490
- 0
Windows/Enigmail+pEp_Bundle.nsi View File

@@ -0,0 +1,490 @@
1
+# Enigmail pEp Bundle
2
+
3
+# Reference
4
+# http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html
5
+# http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html
6
+# http://nsis.sourceforge.net/%22Orange%22_Modern_UI_Theme
7
+
8
+
9
+!addplugindir NSIS\Plugins\x86-ansi
10
+!include "MUI2.nsh"
11
+# deprecated !include InstallOptions.nsh
12
+
13
+
14
+
15
+Outfile "Enigmail+pEp_Bundle.exe"
16
+Name "pEp Thunderbird with Enigmail Bundle"
17
+InstallDir $APPDATA\pEp\BundleInstaller
18
+# InstallDirRegKey HKCU "Software\Modern UI Test" ""
19
+BrandingText "pEp Foundation. Privacy by Default."
20
+
21
+; Vista+ user|admin
22
+# The only guy that refuses to self-elevate is, wonder wonder... Gpg4win
23
+RequestExecutionLevel user
24
+
25
+
26
+Var isAdmin
27
+Var EnvComSpec
28
+# Var WINDIR
29
+Var TbProfileDir
30
+Var TbProfileDirFound
31
+Var TbExec
32
+Var TbExecFound
33
+
34
+# ReserveFile getProfile.bat
35
+# ReserveFile ioFile.ini
36
+
37
+
38
+
39
+
40
+!define MUI_ICON "if_User_No-Frame_97832.ico"
41
+# !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall-nsis.ico"
42
+!define MUI_UNICON ${MUI_ICON}
43
+
44
+!define MUI_HEADERIMAGE
45
+!define MUI_HEADERIMAGE_BITMAP "held.bmp"
46
+# !define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
47
+!define MUI_HEADERIMAGE_UNBITMAP "held.bmp"
48
+!define MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH
49
+!define MUI_HEADERIMAGE_RIGHT
50
+# RRGGBBR
51
+# !define MUI_BGCOLOR AAAAAA9
52
+
53
+!define MUI_WELCOMEFINISHPAGE_BITMAP "held.bmp"
54
+# !define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
55
+!define MUI_UNWELCOMEFINISHPAGE_BITMAP "held.bmp"
56
+# !define MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH
57
+
58
+# !define MUI_WELCOMEFINISHPAGE_INI nsis-pep.ini
59
+
60
+
61
+
62
+
63
+
64
+Icon ${MUI_ICON}
65
+UninstallIcon ${MUI_UNICON}
66
+
67
+
68
+;--------------------------------
69
+;Interface Settings
70
+
71
+# - bad UX
72
+#!define MUI_ABORTWARNING
73
+!define MUI_UNABORTWARNING
74
+
75
+# FIXME TODO: only for debugging:
76
+!define MUI_FINISHPAGE_NOAUTOCLOSE
77
+!define MUI_UNFINISHPAGE_NOAUTOCLOSE
78
+
79
+
80
+
81
+
82
+
83
+!define Trim "!insertmacro Trim"
84
+ 
85
+!macro Trim ResultVar String
86
+  Push "${String}"
87
+  Call Trim
88
+  Pop "${ResultVar}"
89
+!macroend
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+;--------------------------------
101
+;Pages
102
+
103
+!define MUI_WELCOMEPAGE_TITLE "Welcome-Title"
104
+!define MUI_WELCOMEPAGE_TITLE_3LINES "Bla\nBla2\Bla3"
105
+#!define MUI_WELCOMEPAGE_TEXT "Just text"
106
+  !insertmacro MUI_PAGE_WELCOME
107
+  
108
+  
109
+# # Page custom CustomInstallers   nsDialogsPageLeave
110
+# !define MUI_PAGE_CUSTOMFUNCTION_POST DeselectBundleInstall
111
+#   !insertmacro MUI_PAGE_INSTFILES
112
+  
113
+
114
+#Function DeselectBundleInstall
115
+#    !insertmacro UnselectSection "Bundle Install"
116
+#FunctionEnd  
117
+  
118
+
119
+  
120
+  #!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt
121
+
122
+!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPre
123
+!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ComponentsLeave
124
+  !insertmacro MUI_PAGE_COMPONENTS
125
+
126
+
127
+
128
+  
129
+!define MUI_PAGE_CUSTOMFUNCTION_PRE ProfilePre
130
+#!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ProfileLeave
131
+!define MUI_DIRECTORYPAGE_VARIABLE $TbProfileDir
132
+!define MUI_PAGE_HEADER_TEXT "Thunderbird Profile"
133
+!define MUI_PAGE_HEADER_SUBTEXT "Thunderbird Sub-Bla"
134
+  !insertmacro MUI_PAGE_DIRECTORY
135
+
136
+# Second round
137
+# Page custom CustomInstallers   nsDialogsPageLeave
138
+# !define MUI_PAGE_CUSTOMFUNCTION_PRE
139
+  !insertmacro MUI_PAGE_INSTFILES
140
+  
141
+
142
+  
143
+  
144
+  
145
+  
146
+# InstType "Privacy by Default"
147
+# !define CIT_Special 1
148
+# InstType "Online Update"
149
+  
150
+  
151
+  
152
+# http://nsis.sourceforge.net/Reference/Section
153
+
154
+# We deliver the package with and without Thunderbird.
155
+
156
+
157
+Var TbUrl
158
+Var EnvWinDir
159
+Var TbSetupReady
160
+
161
+SectionGroup /e "Thunderbird" SECT_TB
162
+Section "Download" INST_TB_DLOAD
163
+	#SectionIn 2
164
+	SetOutPath $PLUGINSDIR
165
+	Push 0
166
+	Pop $TbSetupReady
167
+	IfFileExists "$INSTDIR\Thunderbird_Setup.exe" TbDownloadOnDisk
168
+	StrCpy $TbUrl "https://download.mozilla.org/?product=thunderbird-latest&os=win&lang=en-US" 
169
+	nsExec::ExecToLog '"$EnvWinDir\System32\bitsadmin.exe" /transfer "Thunderbird" /priority high "$TbUrl" "$INSTDIR\Thunderbird_Setup.exe"'
170
+	Pop $TbSetupReady
171
+TbDownloadOnDisk:
172
+SectionEnd
173
+Section "Install" INST_TB
174
+	#SectionIn 1 2	
175
+	MessageBox MB_OK "Install!$\n$0"
176
+	StrCmp $TbSetupReady 0 +1 NoTbSetupReady
177
+	nsExec::ExecToLog '"$INSTDIR\Thunderbird_Setup.exe" /S'
178
+	Pop $0
179
+NoTbSetupReady:
180
+SectionEnd
181
+Section "New Profile" INST_TB_NEWPROF
182
+	# SectionIn 1 2
183
+	# Repeat
184
+SectionEnd
185
+Section "Select Profile" INST_TB_SELPROF
186
+	# SectionIn 1 2
187
+	# Repeat
188
+SectionEnd
189
+SectionGroupEnd
190
+
191
+Section "Gpg4win" INST_GPGWIN
192
+	SectionIn RO
193
+
194
+	SetOutPath $INSTDIR\gpg4win
195
+	File gpg4win.ini
196
+	
197
+	IfFileExists "$PROGRAMFILES32\GnuPG\bin\gpg.exe" Gpg4winInstalled
198
+	File gpg4win-3.1.1.exe
199
+	File gpg4win_setup.bat
200
+	# There are thousand ways gpg4win does NOT what it was asked,
201
+	# this way it works but the UAC prompt remains in background :(
202
+	nsExec::ExecToLog 'gpg4win_setup.bat gpg4win-3.1.1.exe'
203
+	Pop $0
204
+	
205
+Gpg4winInstalled:
206
+	CreateDirectory "$APPDATA\gnupg"
207
+	SetOutPath "$APPDATA\gnupg"
208
+	
209
+	IfFileExists gpg.conf +2
210
+	File /oname=gpg.conf gpg-pep.conf
211
+	
212
+	IfFileExists gpg-agent.conf +2
213
+	File /oname=gpg-agent.conf gpg-agent-pep.conf
214
+
215
+	IfFileExists gpa.conf +2
216
+	File /oname=gpa.conf gpa-pep.conf
217
+	
218
+SectionEnd
219
+
220
+Section "Enigmail" INST_ENIGMAIL
221
+	#SectionIn 1 2 RO
222
+	SectionIn RO
223
+	
224
+	CreateDirectory $TbProfileDir\extensions\staged
225
+	SetOutPath $TbProfileDir\extensions\staged
226
+	File "/oname={847b3a00-7ab1-11d4-8f02-006008948af5}.xpi" enigmail-2.0.7.xpi
227
+	File "/oname={847b3a00-7ab1-11d4-8f02-006008948af5}.json" staged.json
228
+	
229
+SectionEnd 
230
+
231
+Section "pEp Adapter" INST_MDA
232
+	#SectionIn 1 2 RO
233
+	SectionIn RO
234
+	
235
+	# CreateDirectory
236
+	SetOutPath $TbProfileDir
237
+	File /a /r pepmda\
238
+	
239
+SectionEnd 
240
+
241
+
242
+
243
+
244
+
245
+
246
+  
247
+Function ComponentsPre
248
+	
249
+	# Set selected and readonly, deselecting in ComponentsPost
250
+	#IntOp $0 ${SF_SELECTED} | ${SF_RO}
251
+	#SectionSetFlags ${INST_BUNDLE} $0
252
+
253
+	# ----------------------------------------------
254
+	StrCmp $TbExecFound 0 FoundTb NotFoundTb
255
+	FoundTb:
256
+		IntOp $0 ${SF_RO} | 0
257
+		SectionSetFlags ${INST_TB_DLOAD} $0
258
+		
259
+		# IntOp $0 ${SF_RO} | 0
260
+		IntOp $0 0 | 0
261
+		SectionSetFlags ${INST_TB} $0
262
+		
263
+		Goto FoundTbEnd
264
+	NotFoundTb:
265
+		IntOp $0 ${SF_SELECTED} | ${SF_RO}
266
+		SectionSetFlags ${INST_TB_DLOAD} $0
267
+		
268
+		IntOp $0 ${SF_SELECTED} | 0
269
+		SectionSetFlags ${INST_TB} $0
270
+	FoundTbEnd:
271
+	
272
+	
273
+	# ----------------------------------------------
274
+	StrCmp $TbProfileDirFound 0 FoundTbProf NotFoundTbProf
275
+	FoundTbProf:
276
+		IntOp $0 0 | ${SF_RO}
277
+		SectionSetFlags ${INST_TB_NEWPROF} $0
278
+
279
+		# We keep the Select Profile step always selectable
280
+		# but we don't activate it, as the automatic selection
281
+		# is OK for most users
282
+		IntOp $0 0 | 0
283
+		SectionSetFlags ${INST_TB_SELPROF} $0
284
+		
285
+		Goto FoundTbProfEnd
286
+	NotFoundTbProf:
287
+		IntOp $0 ${SF_SELECTED} | ${SF_RO}
288
+		SectionSetFlags ${INST_TB_NEWPROF} $0
289
+
290
+		IntOp $0 0 | 0
291
+		SectionSetFlags ${INST_TB_SELPROF} $0
292
+	FoundTbProfEnd:
293
+		
294
+FunctionEnd
295
+
296
+  
297
+Function ComponentsLeave
298
+
299
+	#IntOp $0 0 | ${SF_RO}
300
+	#SectionSetFlags ${INST_BUNDLE} $0
301
+FunctionEnd
302
+
303
+
304
+  
305
+
306
+Function ProfilePre
307
+
308
+	StrCpy $TbExec "TB_NOT_FOUND"
309
+	nsExec::ExecToStack '"$EnvComSpec" /C "$PLUGINSDIR\getProfile.bat" getexe'
310
+	Pop $TbExecFound
311
+	Pop $TbExec
312
+	${Trim} $TbExec $TbExec
313
+	
314
+	nsExec::ExecToLog '"$TbExec" -silent -no-remote -createProfile default'
315
+	Pop $0
316
+	
317
+	# TODO: Fail installation if this fails
318
+	
319
+#WaitForProfile:
320
+	# IfFileExists "$INSTDIR\Thunderbird_Setup.exe" TbDownloadOnDisk
321
+	
322
+	StrCpy $TbProfileDir "NO_PROFILE_DIR"
323
+	nsExec::ExecToStack '"$EnvComSpec" /C "$PLUGINSDIR\getProfile.bat" getprofile'
324
+	Pop $TbProfileDirFound
325
+	Pop $TbProfileDir
326
+	${Trim} $TbProfileDir $TbProfileDir
327
+	# IfFileExists "$TbProfileDir" +1 WaitForProfile
328
+	
329
+	# Skip the section if component not selected (using default from script)
330
+	SectionGetFlags ${INST_TB_SELPROF} $0
331
+	IntOp $0 $0 & ${SF_SELECTED}
332
+	StrCmp $0 ${SF_SELECTED} +2 +1
333
+	Abort
334
+FunctionEnd
335
+
336
+Function ProfileLeave
337
+	MessageBox MB_OK "On Leave '$0'"
338
+FunctionEnd
339
+
340
+  
341
+  
342
+  
343
+
344
+
345
+!define MUI_FINISHPAGE_RUN $TbExec
346
+!define MUI_FINISHPAGE_RUN_TEXT "Start Thunderbird"
347
+!define MUI_FINISHPAGE_RUN_PARAMETERS
348
+!define MUI_FINISHPAGE_RUN_NOTCHECKED
349
+# !define MUI_FINISHPAGE_RUN_FUNCTION
350
+!define MUI_FINISHPAGE_SHOWREADME https://pep.coop/cryptoparty/bundle-start.html
351
+!define MUI_FINISHPAGE_SHOWREADME_TEXT "Continue with instructions online"
352
+# !define MUI_FINISHPAGE_SHOWREADME_TEXT
353
+# !define MUI_FINISHPAGE_SHOWREADME_FUNCTION fn
354
+!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
355
+!define MUI_FINISHPAGE_LINK "Important: Join and support the pEp Cooperative today!"
356
+!define MUI_FINISHPAGE_LINK_LOCATION https://software.pep.foundation/ping.html
357
+!define MUI_FINISHPAGE_LINK_COLOR 03aa4b
358
+  !insertmacro MUI_PAGE_FINISH
359
+
360
+  
361
+# Uninstallers!
362
+  !insertmacro MUI_UNPAGE_WELCOME
363
+  !insertmacro MUI_UNPAGE_CONFIRM
364
+  !insertmacro MUI_UNPAGE_INSTFILES
365
+  !insertmacro MUI_UNPAGE_FINISH
366
+
367
+;--------------------------------
368
+;Languages
369
+
370
+  !insertmacro MUI_LANGUAGE "English"
371
+
372
+;--------------------------------
373
+;Installer Sections
374
+
375
+
376
+
377
+
378
+#### !insertmacro INSTALLOPTIONS_WRITE "ioFile.ini" "Field #" "Name" "Value"
379
+
380
+
381
+
382
+Function .onInit
383
+
384
+  #!insertmacro INSTALLOPTIONS_EXTRACT "ioFile.ini"
385
+  
386
+  
387
+#	StrCpy $1 ${secBSPnew} ; Gotta remember which section we are at now...
388
+#	SectionGetFlags ${SecBSPnew} $0
389
+#	IntOp $0 $0 | ${SF_SELECTED}
390
+#	SectionSetFlags ${SecBSPnew} $0
391
+	
392
+	ExpandEnvStrings $EnvComSpec %COMSPEC%
393
+	ExpandEnvStrings $EnvWinDir %WINDIR%
394
+
395
+	InitPluginsDir
396
+    File "/oname=$PLUGINSDIR\getProfile.bat" getProfile.bat
397
+
398
+	StrCpy $TbExec "TB_NOT_FOUND"
399
+	nsExec::ExecToStack '"$EnvComSpec" /C "$PLUGINSDIR\getProfile.bat" getexe'
400
+	Pop $TbExecFound
401
+	Pop $TbExec
402
+	${Trim} $TbExec $TbExec
403
+	
404
+	nsExec::ExecToStack '"$EnvComSpec" /C "$PLUGINSDIR\getProfile.bat" getprofile'
405
+	Pop $TbProfileDirFound
406
+	Pop $TbProfileDir
407
+	${Trim} $TbProfileDir $TbProfileDir
408
+	
409
+	nsExec::ExecToStack 'taskkill /F /IM pep-json-server.exe'
410
+	Pop $0
411
+	Pop $0
412
+	
413
+# File ioFile.ini
414
+
415
+	#File getProfile.bat
416
+# File install.bat
417
+# File installSettings.bat
418
+# File staged.json
419
+
420
+
421
+
422
+
423
+
424
+	
425
+
426
+  
427
+FunctionEnd
428
+
429
+
430
+
431
+Function .onSelChange
432
+
433
+	#SectionGetFlags $1 $0
434
+	#IntOp $0 $0 & ${SECTION_OFF}
435
+	#SectionSetFlags $1 $0
436
+
437
+
438
+FunctionEnd
439
+
440
+
441
+
442
+
443
+Function Trim
444
+	Exch $R1 ; Original string
445
+	Push $R2
446
+ 
447
+Loop:
448
+	StrCpy $R2 "$R1" 1
449
+	StrCmp "$R2" " " TrimLeft
450
+	StrCmp "$R2" "$\r" TrimLeft
451
+	StrCmp "$R2" "$\n" TrimLeft
452
+	StrCmp "$R2" "$\t" TrimLeft
453
+	GoTo Loop2
454
+TrimLeft:	
455
+	StrCpy $R1 "$R1" "" 1
456
+	Goto Loop
457
+ 
458
+Loop2:
459
+	StrCpy $R2 "$R1" 1 -1
460
+	StrCmp "$R2" " " TrimRight
461
+	StrCmp "$R2" "$\r" TrimRight
462
+	StrCmp "$R2" "$\n" TrimRight
463
+	StrCmp "$R2" "$\t" TrimRight
464
+	GoTo Done
465
+TrimRight:	
466
+	StrCpy $R1 "$R1" -1
467
+	Goto Loop2
468
+ 
469
+Done:
470
+	Pop $R2
471
+	Exch $R1
472
+FunctionEnd
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+Section "Uninstall"
482
+
483
+Delete $INSTDIR\UninstallInstaller.exe
484
+
485
+# RMDir "$INSTDIR"
486
+
487
+#   DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
488
+
489
+
490
+SectionEnd

+ 38
- 0
Windows/NSIS/Contrib/ExecDos/ExecDos.sln View File

@@ -0,0 +1,38 @@
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio 2012
4
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExecDos", "ExecDos.vcxproj", "{1A16311F-F8AB-96EA-1ACE-57B17A915730}"
5
+EndProject
6
+Global
7
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
8
+		Debug Unicode|Win32 = Debug Unicode|Win32
9
+		Debug Unicode|x64 = Debug Unicode|x64
10
+		Debug|Win32 = Debug|Win32
11
+		Debug|x64 = Debug|x64
12
+		Release Unicode|Win32 = Release Unicode|Win32
13
+		Release Unicode|x64 = Release Unicode|x64
14
+		Release|Win32 = Release|Win32
15
+		Release|x64 = Release|x64
16
+	EndGlobalSection
17
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
18
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32
19
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32
20
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64
21
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|x64.Build.0 = Debug Unicode|x64
22
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|Win32.ActiveCfg = Debug|Win32
23
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|Win32.Build.0 = Debug|Win32
24
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|x64.ActiveCfg = Debug|x64
25
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|x64.Build.0 = Debug|x64
26
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
27
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|Win32.Build.0 = Release Unicode|Win32
28
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|x64.ActiveCfg = Release Unicode|x64
29
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|x64.Build.0 = Release Unicode|x64
30
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|Win32.ActiveCfg = Release|Win32
31
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|Win32.Build.0 = Release|Win32
32
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|x64.ActiveCfg = Release|x64
33
+		{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|x64.Build.0 = Release|x64
34
+	EndGlobalSection
35
+	GlobalSection(SolutionProperties) = preSolution
36
+		HideSolutionNode = FALSE
37
+	EndGlobalSection
38
+EndGlobal

+ 461
- 0
Windows/NSIS/Contrib/ExecDos/ExecDos.vcxproj View File

@@ -0,0 +1,461 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <ItemGroup Label="ProjectConfigurations">
4
+    <ProjectConfiguration Include="Debug Unicode|Win32">
5
+      <Configuration>Debug Unicode</Configuration>
6
+      <Platform>Win32</Platform>
7
+    </ProjectConfiguration>
8
+    <ProjectConfiguration Include="Debug Unicode|x64">
9
+      <Configuration>Debug Unicode</Configuration>
10
+      <Platform>x64</Platform>
11
+    </ProjectConfiguration>
12
+    <ProjectConfiguration Include="Debug|Win32">
13
+      <Configuration>Debug</Configuration>
14
+      <Platform>Win32</Platform>
15
+    </ProjectConfiguration>
16
+    <ProjectConfiguration Include="Debug|x64">
17
+      <Configuration>Debug</Configuration>
18
+      <Platform>x64</Platform>
19
+    </ProjectConfiguration>
20
+    <ProjectConfiguration Include="Release Unicode|Win32">
21
+      <Configuration>Release Unicode</Configuration>
22
+      <Platform>Win32</Platform>
23
+    </ProjectConfiguration>
24
+    <ProjectConfiguration Include="Release Unicode|x64">
25
+      <Configuration>Release Unicode</Configuration>
26
+      <Platform>x64</Platform>
27
+    </ProjectConfiguration>
28
+    <ProjectConfiguration Include="Release|Win32">
29
+      <Configuration>Release</Configuration>
30
+      <Platform>Win32</Platform>
31
+    </ProjectConfiguration>
32
+    <ProjectConfiguration Include="Release|x64">
33
+      <Configuration>Release</Configuration>
34
+      <Platform>x64</Platform>
35
+    </ProjectConfiguration>
36
+  </ItemGroup>
37
+  <PropertyGroup Label="Globals">
38
+    <SccProjectName />
39
+    <SccLocalPath />
40
+    <ProjectGuid>{1A16311F-F8AB-96EA-1ACE-57B17A915730}</ProjectGuid>
41
+  </PropertyGroup>
42
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
43
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
44
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
45
+    <CharacterSet>MultiByte</CharacterSet>
46
+    <PlatformToolset>v110</PlatformToolset>
47
+  </PropertyGroup>
48
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
49
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
50
+    <CharacterSet>MultiByte</CharacterSet>
51
+    <PlatformToolset>v110</PlatformToolset>
52
+  </PropertyGroup>
53
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="Configuration">
54
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
55
+    <CharacterSet>Unicode</CharacterSet>
56
+    <PlatformToolset>v110</PlatformToolset>
57
+  </PropertyGroup>
58
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="Configuration">
59
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
60
+    <CharacterSet>Unicode</CharacterSet>
61
+    <PlatformToolset>v110</PlatformToolset>
62
+  </PropertyGroup>
63
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
64
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
65
+    <CharacterSet>MultiByte</CharacterSet>
66
+    <PlatformToolset>v110</PlatformToolset>
67
+  </PropertyGroup>
68
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
69
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
70
+    <CharacterSet>MultiByte</CharacterSet>
71
+    <PlatformToolset>v110</PlatformToolset>
72
+  </PropertyGroup>
73
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="Configuration">
74
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
75
+    <CharacterSet>Unicode</CharacterSet>
76
+    <PlatformToolset>v110</PlatformToolset>
77
+  </PropertyGroup>
78
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="Configuration">
79
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
80
+    <CharacterSet>Unicode</CharacterSet>
81
+    <PlatformToolset>v110</PlatformToolset>
82
+  </PropertyGroup>
83
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
84
+  <ImportGroup Label="ExtensionSettings">
85
+  </ImportGroup>
86
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
87
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
88
+    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
89
+  </ImportGroup>
90
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
91
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
92
+    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
93
+  </ImportGroup>
94
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="PropertySheets">
95
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
96
+    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
97
+  </ImportGroup>
98
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="PropertySheets">
99
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
100
+    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
101
+  </ImportGroup>
102
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
103
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
104
+    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
105
+  </ImportGroup>
106
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
107
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
108
+    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
109
+  </ImportGroup>
110
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="PropertySheets">
111
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
112
+    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
113
+  </ImportGroup>
114
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="PropertySheets">
115
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
116
+    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
117
+  </ImportGroup>
118
+  <PropertyGroup Label="UserMacros" />
119
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
120
+    <LinkIncremental>false</LinkIncremental>
121
+    <GenerateManifest>false</GenerateManifest>
122
+    <OutDir>$(SolutionDir)..\..\Plugins\x86-ansi</OutDir>
123
+  </PropertyGroup>
124
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
125
+    <LinkIncremental>false</LinkIncremental>
126
+    <GenerateManifest>false</GenerateManifest>
127
+    <OutDir>$(SolutionDir)..\..\Plugins\x64-ansi</OutDir>
128
+  </PropertyGroup>
129
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
130
+    <LinkIncremental>false</LinkIncremental>
131
+    <GenerateManifest>false</GenerateManifest>
132
+    <OutDir>$(SolutionDir)..\..\Plugins\x86-unicode</OutDir>
133
+  </PropertyGroup>
134
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
135
+    <LinkIncremental>false</LinkIncremental>
136
+    <GenerateManifest>false</GenerateManifest>
137
+    <OutDir>$(SolutionDir)..\..\Plugins\x64-unicode</OutDir>
138
+  </PropertyGroup>
139
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
140
+    <LinkIncremental>false</LinkIncremental>
141
+    <GenerateManifest>false</GenerateManifest>
142
+    <OutDir>$(SolutionDir)..\..\Plugins\x86-ansi</OutDir>
143
+  </PropertyGroup>
144
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
145
+    <LinkIncremental>false</LinkIncremental>
146
+    <GenerateManifest>false</GenerateManifest>
147
+    <OutDir>$(SolutionDir)..\..\Plugins\x64-ansi</OutDir>
148
+  </PropertyGroup>
149
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
150
+    <LinkIncremental>false</LinkIncremental>
151
+    <GenerateManifest>false</GenerateManifest>
152
+    <OutDir>$(SolutionDir)..\..\Plugins\x86-unicode</OutDir>
153
+  </PropertyGroup>
154
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
155
+    <LinkIncremental>false</LinkIncremental>
156
+    <GenerateManifest>false</GenerateManifest>
157
+    <OutDir>$(SolutionDir)..\..\Plugins\x64-unicode</OutDir>
158
+  </PropertyGroup>
159
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
160
+    <ClCompile>
161
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
162
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
163
+      <StringPooling>true</StringPooling>
164
+      <Optimization>MinSpace</Optimization>
165
+      <SuppressStartupBanner>true</SuppressStartupBanner>
166
+      <WarningLevel>Level3</WarningLevel>
167
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
168
+      <BufferSecurityCheck>false</BufferSecurityCheck>
169
+      <FunctionLevelLinking>true</FunctionLevelLinking>
170
+    </ClCompile>
171
+    <Midl>
172
+      <SuppressStartupBanner>true</SuppressStartupBanner>
173
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
174
+      <TypeLibraryName>.\../debug\ExecDos.tlb</TypeLibraryName>
175
+      <MkTypLibCompatible>true</MkTypLibCompatible>
176
+      <TargetEnvironment>Win32</TargetEnvironment>
177
+    </Midl>
178
+    <ResourceCompile>
179
+      <Culture>0x0409</Culture>
180
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
181
+    </ResourceCompile>
182
+    <Bscmake>
183
+      <SuppressStartupBanner>true</SuppressStartupBanner>
184
+      <OutputFile>.\../debug\ExecDos.bsc</OutputFile>
185
+    </Bscmake>
186
+    <Link>
187
+      <SuppressStartupBanner>true</SuppressStartupBanner>
188
+      <LinkDLL>true</LinkDLL>
189
+      <SubSystem>Console</SubSystem>
190
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
191
+      <AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
192
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
193
+    </Link>
194
+  </ItemDefinitionGroup>
195
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
196
+    <ClCompile>
197
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
198
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
199
+      <StringPooling>true</StringPooling>
200
+      <Optimization>MinSpace</Optimization>
201
+      <SuppressStartupBanner>true</SuppressStartupBanner>
202
+      <WarningLevel>Level3</WarningLevel>
203
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
204
+      <BufferSecurityCheck>false</BufferSecurityCheck>
205
+      <FunctionLevelLinking>true</FunctionLevelLinking>
206
+    </ClCompile>
207
+    <Midl>
208
+      <SuppressStartupBanner>true</SuppressStartupBanner>
209
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
210
+      <TypeLibraryName>.\../debug\ExecDos.tlb</TypeLibraryName>
211
+      <MkTypLibCompatible>true</MkTypLibCompatible>
212
+    </Midl>
213
+    <ResourceCompile>
214
+      <Culture>0x0409</Culture>
215
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
216
+    </ResourceCompile>
217
+    <Bscmake>
218
+      <SuppressStartupBanner>true</SuppressStartupBanner>
219
+      <OutputFile>.\../debug\ExecDos.bsc</OutputFile>
220
+    </Bscmake>
221
+    <Link>
222
+      <SuppressStartupBanner>true</SuppressStartupBanner>
223
+      <LinkDLL>true</LinkDLL>
224
+      <SubSystem>Console</SubSystem>
225
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
226
+      <AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
227
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
228
+    </Link>
229
+  </ItemDefinitionGroup>
230
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
231
+    <ClCompile>
232
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
233
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
234
+      <StringPooling>true</StringPooling>
235
+      <Optimization>MinSpace</Optimization>
236
+      <SuppressStartupBanner>true</SuppressStartupBanner>
237
+      <WarningLevel>Level3</WarningLevel>
238
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
239
+      <BufferSecurityCheck>false</BufferSecurityCheck>
240
+      <FunctionLevelLinking>true</FunctionLevelLinking>
241
+    </ClCompile>
242
+    <Midl>
243
+      <SuppressStartupBanner>true</SuppressStartupBanner>
244
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
245
+      <TypeLibraryName>.\../debug\ExecDos.tlb</TypeLibraryName>
246
+      <MkTypLibCompatible>true</MkTypLibCompatible>
247
+      <TargetEnvironment>Win32</TargetEnvironment>
248
+    </Midl>
249
+    <ResourceCompile>
250
+      <Culture>0x0409</Culture>
251
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
252
+    </ResourceCompile>
253
+    <Bscmake>
254
+      <SuppressStartupBanner>true</SuppressStartupBanner>
255
+      <OutputFile>.\../debug\ExecDos.bsc</OutputFile>
256
+    </Bscmake>
257
+    <Link>
258
+      <SuppressStartupBanner>true</SuppressStartupBanner>
259
+      <LinkDLL>true</LinkDLL>
260
+      <SubSystem>Console</SubSystem>
261
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
262
+      <AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
263
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
264
+    </Link>
265
+  </ItemDefinitionGroup>
266
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
267
+    <ClCompile>
268
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
269
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
270
+      <StringPooling>true</StringPooling>
271
+      <Optimization>MinSpace</Optimization>
272
+      <SuppressStartupBanner>true</SuppressStartupBanner>
273
+      <WarningLevel>Level3</WarningLevel>
274
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
275
+      <BufferSecurityCheck>false</BufferSecurityCheck>
276
+      <FunctionLevelLinking>true</FunctionLevelLinking>
277
+    </ClCompile>
278
+    <Midl>
279
+      <SuppressStartupBanner>true</SuppressStartupBanner>
280
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
281
+      <TypeLibraryName>.\../debug\ExecDos.tlb</TypeLibraryName>
282
+      <MkTypLibCompatible>true</MkTypLibCompatible>
283
+    </Midl>
284
+    <ResourceCompile>
285
+      <Culture>0x0409</Culture>
286
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
287
+    </ResourceCompile>
288
+    <Bscmake>
289
+      <SuppressStartupBanner>true</SuppressStartupBanner>
290
+      <OutputFile>.\../debug\ExecDos.bsc</OutputFile>
291
+    </Bscmake>
292
+    <Link>
293
+      <SuppressStartupBanner>true</SuppressStartupBanner>
294
+      <LinkDLL>true</LinkDLL>
295
+      <SubSystem>Console</SubSystem>
296
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
297
+      <AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
298
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
299
+    </Link>
300
+  </ItemDefinitionGroup>
301
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
302
+    <ClCompile>
303
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
304
+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
305
+      <FunctionLevelLinking>false</FunctionLevelLinking>
306
+      <Optimization>Disabled</Optimization>
307
+      <SuppressStartupBanner>true</SuppressStartupBanner>
308
+      <WarningLevel>Level3</WarningLevel>
309
+      <MinimalRebuild>true</MinimalRebuild>
310
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
311
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
312
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
313
+      <BufferSecurityCheck>true</BufferSecurityCheck>
314
+    </ClCompile>
315
+    <Midl>
316
+      <SuppressStartupBanner>true</SuppressStartupBanner>
317
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
318
+      <TypeLibraryName>.\../Debug\ExecDos.tlb</TypeLibraryName>
319
+      <MkTypLibCompatible>true</MkTypLibCompatible>
320
+      <TargetEnvironment>Win32</TargetEnvironment>
321
+    </Midl>
322
+    <ResourceCompile>
323
+      <Culture>0x0409</Culture>
324
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
325
+    </ResourceCompile>
326
+    <Bscmake>
327
+      <SuppressStartupBanner>true</SuppressStartupBanner>
328
+      <OutputFile>.\../Debug\ExecDos.bsc</OutputFile>
329
+    </Bscmake>
330
+    <Link>
331
+      <SuppressStartupBanner>true</SuppressStartupBanner>
332
+      <LinkDLL>true</LinkDLL>
333
+      <GenerateDebugInformation>false</GenerateDebugInformation>
334
+      <SubSystem>Console</SubSystem>
335
+      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
336
+    </Link>
337
+  </ItemDefinitionGroup>
338
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
339
+    <ClCompile>
340
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
341
+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
342
+      <FunctionLevelLinking>false</FunctionLevelLinking>
343
+      <Optimization>Disabled</Optimization>
344
+      <SuppressStartupBanner>true</SuppressStartupBanner>
345
+      <WarningLevel>Level3</WarningLevel>
346
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
347
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
348
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
349
+      <BufferSecurityCheck>true</BufferSecurityCheck>
350
+    </ClCompile>
351
+    <Midl>
352
+      <SuppressStartupBanner>true</SuppressStartupBanner>
353
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
354
+      <TypeLibraryName>.\../Debug\ExecDos.tlb</TypeLibraryName>
355
+      <MkTypLibCompatible>true</MkTypLibCompatible>
356
+    </Midl>
357
+    <ResourceCompile>
358
+      <Culture>0x0409</Culture>
359
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
360
+    </ResourceCompile>
361
+    <Bscmake>
362
+      <SuppressStartupBanner>true</SuppressStartupBanner>
363
+      <OutputFile>.\../Debug\ExecDos.bsc</OutputFile>
364
+    </Bscmake>
365
+    <Link>
366
+      <SuppressStartupBanner>true</SuppressStartupBanner>
367
+      <LinkDLL>true</LinkDLL>
368
+      <GenerateDebugInformation>false</GenerateDebugInformation>
369
+      <SubSystem>Console</SubSystem>
370
+      <AdditionalDependencies>nsis_ansi\pluginapi.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
371
+    </Link>
372
+  </ItemDefinitionGroup>
373
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
374
+    <ClCompile>
375
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
376
+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
377
+      <FunctionLevelLinking>false</FunctionLevelLinking>
378
+      <Optimization>Disabled</Optimization>
379
+      <SuppressStartupBanner>true</SuppressStartupBanner>
380
+      <WarningLevel>Level3</WarningLevel>
381
+      <MinimalRebuild>true</MinimalRebuild>
382
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
383
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
384
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
385
+      <BufferSecurityCheck>true</BufferSecurityCheck>
386
+    </ClCompile>
387
+    <Midl>
388
+      <SuppressStartupBanner>true</SuppressStartupBanner>
389
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
390
+      <TypeLibraryName>.\../Debug\ExecDos.tlb</TypeLibraryName>
391
+      <MkTypLibCompatible>true</MkTypLibCompatible>
392
+      <TargetEnvironment>Win32</TargetEnvironment>
393
+    </Midl>
394
+    <ResourceCompile>
395
+      <Culture>0x0409</Culture>
396
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
397
+    </ResourceCompile>
398
+    <Bscmake>
399
+      <SuppressStartupBanner>true</SuppressStartupBanner>
400
+      <OutputFile>.\../Debug\ExecDos.bsc</OutputFile>
401
+    </Bscmake>
402
+    <Link>
403
+      <SuppressStartupBanner>true</SuppressStartupBanner>
404
+      <LinkDLL>true</LinkDLL>
405
+      <GenerateDebugInformation>false</GenerateDebugInformation>
406
+      <SubSystem>Console</SubSystem>
407
+      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
408
+    </Link>
409
+  </ItemDefinitionGroup>
410
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
411
+    <ClCompile>
412
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
413
+      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
414
+      <FunctionLevelLinking>false</FunctionLevelLinking>
415
+      <Optimization>Disabled</Optimization>
416
+      <SuppressStartupBanner>true</SuppressStartupBanner>
417
+      <WarningLevel>Level3</WarningLevel>
418
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
419
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
420
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
421
+      <BufferSecurityCheck>true</BufferSecurityCheck>
422
+    </ClCompile>
423
+    <Midl>
424
+      <SuppressStartupBanner>true</SuppressStartupBanner>
425
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
426
+      <TypeLibraryName>.\../Debug\ExecDos.tlb</TypeLibraryName>
427
+      <MkTypLibCompatible>true</MkTypLibCompatible>
428
+    </Midl>
429
+    <ResourceCompile>
430
+      <Culture>0x0409</Culture>
431
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
432
+    </ResourceCompile>
433
+    <Bscmake>
434
+      <SuppressStartupBanner>true</SuppressStartupBanner>
435
+      <OutputFile>.\../Debug\ExecDos.bsc</OutputFile>
436
+    </Bscmake>
437
+    <Link>
438
+      <SuppressStartupBanner>true</SuppressStartupBanner>
439
+      <LinkDLL>true</LinkDLL>
440
+      <GenerateDebugInformation>false</GenerateDebugInformation>
441
+      <SubSystem>Console</SubSystem>
442
+      <AdditionalDependencies>nsis_unicode\pluginapi.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
443
+    </Link>
444
+  </ItemDefinitionGroup>
445
+  <ItemGroup>
446
+    <ClCompile Include="execDos.c" />
447
+    <ClCompile Include="pluginapi.c" />
448
+  </ItemGroup>
449
+  <ItemGroup>
450
+    <ClInclude Include="api.h" />
451
+    <ClInclude Include="nsis_tchar.h" />
452
+    <ClInclude Include="pluginapi.h" />
453
+    <ClInclude Include="resource.h" />
454
+  </ItemGroup>
455
+  <ItemGroup>
456
+    <ResourceCompile Include="execDos.rc" />
457
+  </ItemGroup>
458
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
459
+  <ImportGroup Label="ExtensionTargets">
460
+  </ImportGroup>
461
+</Project>

+ 44
- 0
Windows/NSIS/Contrib/ExecDos/ExecDos.vcxproj.filters View File

@@ -0,0 +1,44 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <ItemGroup>
4
+    <Filter Include="Source Files">
5
+      <UniqueIdentifier>{e6ac57b0-521c-4d5a-b4e8-d04324cd751f}</UniqueIdentifier>
6
+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
7
+    </Filter>
8
+    <Filter Include="Header Files">
9
+      <UniqueIdentifier>{affd3ad4-c2c0-4025-80fc-5b2b7b4c6ffc}</UniqueIdentifier>
10
+      <Extensions>h;hpp;hxx;hm;inl</Extensions>
11
+    </Filter>
12
+    <Filter Include="Resource Files">
13
+      <UniqueIdentifier>{cee8647c-748e-4045-9a4c-08eb637ef52c}</UniqueIdentifier>
14
+      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
15
+    </Filter>
16
+  </ItemGroup>
17
+  <ItemGroup>
18
+    <ClCompile Include="execDos.c">
19
+      <Filter>Source Files</Filter>
20
+    </ClCompile>
21
+    <ClCompile Include="pluginapi.c">
22
+      <Filter>Source Files</Filter>
23
+    </ClCompile>
24
+  </ItemGroup>
25
+  <ItemGroup>
26
+    <ClInclude Include="api.h">
27
+      <Filter>Header Files</Filter>
28
+    </ClInclude>
29
+    <ClInclude Include="pluginapi.h">
30
+      <Filter>Header Files</Filter>
31
+    </ClInclude>
32
+    <ClInclude Include="nsis_tchar.h">
33
+      <Filter>Header Files</Filter>
34
+    </ClInclude>
35
+    <ClInclude Include="resource.h">
36
+      <Filter>Header Files</Filter>
37
+    </ClInclude>
38
+  </ItemGroup>
39
+  <ItemGroup>
40
+    <ResourceCompile Include="execDos.rc">
41
+      <Filter>Source Files</Filter>
42
+    </ResourceCompile>
43
+  </ItemGroup>
44
+</Project>

+ 83
- 0
Windows/NSIS/Contrib/ExecDos/api.h View File

@@ -0,0 +1,83 @@
1
+/*
2
+ * apih
3
+ * 
4
+ * This file is a part of NSIS.
5
+ * 
6
+ * Copyright (C) 1999-2013 Nullsoft and Contributors
7
+ * 
8
+ * Licensed under the zlib/libpng license (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * 
11
+ * Licence details can be found in the file COPYING.
12
+ * 
13
+ * This software is provided 'as-is', without any express or implied
14
+ * warranty.
15
+ */
16
+
17
+#ifndef _NSIS_EXEHEAD_API_H_
18
+#define _NSIS_EXEHEAD_API_H_
19
+
20
+// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
21
+// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
22
+// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
23
+
24
+#define NSISPIAPIVER_1_0 0x00010000
25
+#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
26
+
27
+// NSIS Plug-In Callback Messages
28
+enum NSPIM 
29
+{
30
+	NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup
31
+	NSPIM_GUIUNLOAD, // Called after .onGUIEnd
32
+};
33
+
34
+// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
35
+// Return NULL for unknown messages
36
+// Should always be __cdecl for future expansion possibilities
37
+typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
38
+
39
+// extra_parameters data structures containing other interesting stuff
40
+// but the stack, variables and HWND passed on to plug-ins.
41
+typedef struct
42
+{
43
+  int autoclose;
44
+  int all_user_var;
45
+  int exec_error;
46
+  int abort;
47
+  int exec_reboot; // NSIS_SUPPORT_REBOOT
48
+  int reboot_called; // NSIS_SUPPORT_REBOOT
49
+  int XXX_cur_insttype; // depreacted
50
+  int plugin_api_version; // see NSISPIAPIVER_CURR
51
+                          // used to be XXX_insttype_changed
52
+  int silent; // NSIS_CONFIG_SILENT_SUPPORT
53
+  int instdir_error;
54
+  int rtl;
55
+  int errlvl;
56
+  int alter_reg_view;
57
+  int status_update;
58
+} exec_flags_t;
59
+
60
+#ifndef NSISCALL
61
+#  define NSISCALL __stdcall
62
+#endif
63
+
64
+typedef struct {
65
+  exec_flags_t *exec_flags;
66
+  int (NSISCALL *ExecuteCodeSegment)(int, HWND);
67
+  void (NSISCALL *validate_filename)(TCHAR *);
68
+  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
69
+} extra_parameters;
70
+
71
+// Definitions for page showing plug-ins
72
+// See Ui.c to understand better how they're used
73
+
74
+// sent to the outer window to tell it to go to the next inner window
75
+#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
76
+
77
+// custom pages should send this message to let NSIS know they're ready
78
+#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
79
+
80
+// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
81
+#define NOTIFY_BYE_BYE 'x'
82
+
83
+#endif /* _PLUGIN_H_ */

+ 40
- 0
Windows/NSIS/Contrib/ExecDos/consApp.cpp View File

@@ -0,0 +1,40 @@
1
+#include <windows.h>
2
+#include <stdio.h>
3
+
4
+#pragma comment(linker,"/MERGE:.rdata=.text")
5
+#pragma comment(linker,"/FILEALIGN:512 /SECTION:.text,EWRX /IGNORE:4078")
6
+#pragma comment(linker,"/ENTRY:main")
7
+#pragma comment(linker,"/NODEFAULTLIB")
8
+
9
+int main( int argc, char **argv)
10
+{
11
+   char b[1024] = "";
12
+   printf("This is test console application for execDos plugin\n");
13
+   printf("Written by Takhir Bedertdinov\n\n");
14
+   fflush(NULL);
15
+   Sleep(500);
16
+   printf("Login: ");
17
+   fflush(NULL);
18
+   Sleep(500);
19
+//   fgets(b, sizeof(b), stdin);// generates error in msvcrt
20
+   gets(b);
21
+   printf("%s\n", b);
22
+/*MessageBox(NULL, "Login received", b, 0);*/
23
+   fflush(NULL);
24
+   Sleep(500);
25
+   printf("Passowrd: ");
26
+   fflush(NULL);
27
+   Sleep(500);
28
+   *b = 0;
29
+//   fgets(b, sizeof(b), stdin);
30
+   gets(b);
31
+   printf("%s\n", b);
32
+   fflush(NULL);
33
+   Sleep(500);
34
+/*MessageBox(NULL, "Password received", b, 0);*/
35
+   printf("\nThanks\nBla-bla-bla\nBye\n");
36
+   fflush(NULL);
37
+   Sleep(500);
38
+	return 5;
39
+}
40
+

+ 91
- 0
Windows/NSIS/Contrib/ExecDos/consApp.dsp View File

@@ -0,0 +1,91 @@
1
+# Microsoft Developer Studio Project File - Name="consApp" - Package Owner=<4>
2
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
3
+# ** DO NOT EDIT **
4
+
5
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
+
7
+CFG=consApp - Win32 Debug
8
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
9
+!MESSAGE use the Export Makefile command and run
10
+!MESSAGE 
11
+!MESSAGE NMAKE /f "consApp.mak".
12
+!MESSAGE 
13
+!MESSAGE You can specify a configuration when running NMAKE
14
+!MESSAGE by defining the macro CFG on the command line. For example:
15
+!MESSAGE 
16
+!MESSAGE NMAKE /f "consApp.mak" CFG="consApp - Win32 Debug"
17
+!MESSAGE 
18
+!MESSAGE Possible choices for configuration are:
19
+!MESSAGE 
20
+!MESSAGE "consApp - Win32 Release" (based on "Win32 (x86) Console Application")
21
+!MESSAGE "consApp - Win32 Debug" (based on "Win32 (x86) Console Application")
22
+!MESSAGE 
23
+
24
+# Begin Project
25
+# PROP AllowPerConfigDependencies 0
26
+# PROP Scc_ProjName ""
27
+# PROP Scc_LocalPath ""
28
+CPP=cl.exe
29
+RSC=rc.exe
30
+
31
+!IF  "$(CFG)" == "consApp - Win32 Release"
32
+
33
+# PROP BASE Use_MFC 0
34
+# PROP BASE Use_Debug_Libraries 0
35
+# PROP BASE Output_Dir "Release"
36
+# PROP BASE Intermediate_Dir "Release"
37
+# PROP BASE Target_Dir ""
38
+# PROP Use_MFC 0
39
+# PROP Use_Debug_Libraries 0
40
+# PROP Output_Dir "Release"
41
+# PROP Intermediate_Dir "Release"
42
+# PROP Ignore_Export_Lib 0
43
+# PROP Target_Dir ""
44
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45
+# ADD CPP /nologo /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
46
+# SUBTRACT CPP /YX
47
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
48
+# ADD RSC /l 0x419 /d "NDEBUG"
49
+BSC32=bscmake.exe
50
+# ADD BASE BSC32 /nologo
51
+# ADD BSC32 /nologo
52
+LINK32=link.exe
53
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
54
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib msvcrt.lib /nologo /subsystem:console /machine:I386 /opt:nowin98 /OPT:REF /OPT:ICF
55
+# SUBTRACT LINK32 /pdb:none /nodefaultlib
56
+
57
+!ELSEIF  "$(CFG)" == "consApp - Win32 Debug"
58
+
59
+# PROP BASE Use_MFC 0
60
+# PROP BASE Use_Debug_Libraries 1
61
+# PROP BASE Output_Dir "Debug"
62
+# PROP BASE Intermediate_Dir "Debug"
63
+# PROP BASE Target_Dir ""
64
+# PROP Use_MFC 0
65
+# PROP Use_Debug_Libraries 1
66
+# PROP Output_Dir "Debug"
67
+# PROP Intermediate_Dir "Debug"
68
+# PROP Target_Dir ""
69
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
70
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
71
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
72
+# ADD RSC /l 0x419 /d "_DEBUG"
73
+BSC32=bscmake.exe
74
+# ADD BASE BSC32 /nologo
75
+# ADD BSC32 /nologo
76
+LINK32=link.exe
77
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
78
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
79
+
80
+!ENDIF 
81
+
82
+# Begin Target
83
+
84
+# Name "consApp - Win32 Release"
85
+# Name "consApp - Win32 Debug"
86
+# Begin Source File
87
+
88
+SOURCE=.\consApp.cpp
89
+# End Source File
90
+# End Target
91
+# End Project

+ 508
- 0
Windows/NSIS/Contrib/ExecDos/execDos.c View File

@@ -0,0 +1,508 @@
1
+/***************************************************
2
+* FILE NAME: execDos.c
3
+*
4
+* PURPOSE:
5
+*   NSIS plugin for DOS (console) applications.
6
+*   Creates child process with redirected I/O.
7
+*   Catches application's output and can put it to the
8
+*   log file. Returns process exit code or error code.
9
+*
10
+* CHANGE HISTORY
11
+*
12
+* $LOG$
13
+*
14
+* Author              Version  Date         Modifications
15
+* Takhir Bedertdinov           May 31 2004  Original
16
+*   --//--                     Oct 31 2004  Log output
17
+*   --//--                     Feb 10 2005  /TIMEOUT option
18
+*   --//--                     Jul 23 2005  /ASYNC option
19
+*   --//--                     Jul 25 2005  multithreading
20
+*   --//--                     Mar 10 2006  perf. improved
21
+*   --//--                     Jul 25 2006  to stack option
22
+*   --//--                     Dec 12 2006  detailed option
23
+* Stuart Welch                 Jul 27 2007  func options
24
+*   --//--                                  isdone func
25
+* Takhir Bedertdinov           Jul 28 2007  to window option
26
+* Stuart Welch                 Jan 18 2011  Unicode build
27
+*   --//--                                  NSIS plugin API update (no /NOUNLOAD)
28
+*   --//--                                  /DISABLEFSR option for WOW64
29
+*   --//--            1.0.1.2  Apr 13 2014  x64 build
30
+*   --//--                                  version info resource
31
+*   --//--            1.0.1.3  Dec 11 2014  incorrect Unicode GlobalAlloc size
32
+*                                           STDIN Unicode ANSI conversion
33
+*
34
+* Takhir Bedertdinov, Moscow, Russia, ineum@narod.ru
35
+* Stuart 'Afrow UK' Welch, afrowuk@afrowsoft.co.uk
36
+**************************************************/
37
+
38
+#include <windows.h>
39
+#include <fcntl.h>
40
+#include <stdio.h>
41
+#include <io.h>
42
+#include <sys\stat.h>
43
+#include "COMMCTRL.H"
44
+#include "pluginapi.h"
45
+
46
+#define NSISFUNC(name) void __declspec(dllexport) name(HWND hWndParent, int string_size, TCHAR* variables, stack_t** stacktop, extra_parameters* extra)
47
+
48
+enum ERROR_CODES {
49
+  ERR_DUPHANDLE = -16,
50
+  ERR_CREATEPIPE,
51
+  ERR_CREATEPROC,
52
+  ERR_CLOSEHANDLE,
53
+  ERR_WRITEPIPE,
54
+  ERR_GETEXITCODE,
55
+  ERR_LOGOPEN,
56
+  ERR_LOGWRITE,
57
+  ERR_TERMINATED,
58
+  ERR_CREATETHREAD
59
+};
60
+
61
+enum OUT_OPTIONS {
62
+  OUT_FILE,
63
+  OUT_STACK,
64
+  OUT_WINDOW,
65
+  OUT_FUNCTION
66
+};
67
+
68
+#define SLEEP_MS 10
69
+#define T_O        TEXT("/TIMEOUT")
70
+#define N_W        TEXT("/ASYNC")
71
+#define TOSTACK    TEXT("/TOSTACK")
72
+#define DETAILED   TEXT("/DETAILED")
73
+#define TOWINDOW   TEXT("/TOWINDOW")
74
+#define TOFUNC     TEXT("/TOFUNC")
75
+#define DISABLEFSR TEXT("/DISABLEFSR")
76
+#define ENDFUNC    TEXT("/ENDFUNC")
77
+
78
+typedef struct _threadParams {
79
+  TCHAR *dosExec;
80
+  TCHAR *pipeWrite;
81
+  DWORD target;
82
+  BOOL disableFsR;
83
+  TCHAR *logFile;
84
+  DWORD timeout;
85
+  HWND hOut;
86
+  LONG lFuncAddress;
87
+  LONG lEndFuncAddress;
88
+} threadParams, *pthreadParams;
89
+
90
+typedef BOOL (WINAPI* PWow64EnableWow64FsRedirection)(BOOL);
91
+
92
+extra_parameters* ep;
93
+HANDLE g_hInstance;
94
+
95
+/*****************************************************
96
+ * FUNCTION NAME: my_strchr()
97
+ * PURPOSE: 
98
+ *   libc/msvcrt replacements
99
+ *****************************************************/
100
+TCHAR *my_strchr(TCHAR *s, TCHAR c)
101
+{
102
+  while(*s != 0)
103
+  {
104
+    if(*s == c)
105
+      return s;
106
+    s++;
107
+  }
108
+  return NULL;
109
+}
110
+
111
+/*****************************************************
112
+* FUNCTION NAME: redirect()
113
+* PURPOSE: 
114
+*   Creates child process with redirected IO
115
+* SPECIAL CONSIDERATIONS:
116
+*
117
+*****************************************************/
118
+DWORD __stdcall redirect(void *pp)
119
+{
120
+  HANDLE hOutputReadTmp,hOutputRead,hOutputWrite;
121
+  HANDLE hInputWriteTmp,hInputRead,hInputWrite;
122
+  HANDLE hErrorWrite;
123
+  PROCESS_INFORMATION pi;
124
+  STARTUPINFO *psi = (STARTUPINFO*)GlobalAlloc(GPTR, sizeof(STARTUPINFO));
125
+  SECURITY_ATTRIBUTES sa;
126
+  HANDLE f = INVALID_HANDLE_VALUE;
127
+  DWORD rslt = 0,
128
+    waitTime = 0,
129
+    dwRead = 0;
130
+  char b[256];
131
+  TCHAR *szStack = NULL;
132
+  unsigned int iStack = 0, iPipeWrite;
133
+  pthreadParams ptp = (pthreadParams)pp;
134
+  LVITEM lvItem;
135
+  lvItem.mask = LVIF_TEXT;
136
+  lvItem.iItem = 0;
137
+  lvItem.iSubItem = 0;
138
+  lvItem.pszText = NULL;
139
+  lvItem.cchTextMax = 0;
140
+
141
+	iPipeWrite = lstrlen(ptp->pipeWrite);
142
+  
143
+  /* creates child process with redirected IO */
144
+  sa.nLength= sizeof(SECURITY_ATTRIBUTES);
145
+  sa.lpSecurityDescriptor = NULL;
146
+  sa.bInheritHandle = TRUE;
147
+  if(ptp->target != OUT_FILE)
148
+  {
149
+    szStack = (TCHAR*)GlobalAlloc(GPTR, sizeof(TCHAR) * (g_stringsize + 2));
150
+    lvItem.pszText = szStack;
151
+  }
152
+
153
+  /* disable WOW64 file system redirection */
154
+  if (ptp->disableFsR)
155
+  {
156
+    HINSTANCE hDll = GetModuleHandle(TEXT("kernel32.dll"));
157
+    PWow64EnableWow64FsRedirection Wow64EnableWow64FsRedirection = (PWow64EnableWow64FsRedirection)GetProcAddress(hDll, "Wow64EnableWow64FsRedirection");
158
+    if (Wow64EnableWow64FsRedirection != NULL)
159
+      Wow64EnableWow64FsRedirection(FALSE);
160
+  }
161
+  
162
+  while(1)
163
+  {
164
+    /* creating pipes for child process with redirected IO */
165
+    if(!CreatePipe(&hOutputReadTmp,&hOutputWrite,&sa,0) ||
166
+      !CreatePipe(&hInputRead,&hInputWriteTmp,&sa,0))
167
+    { rslt = ERR_CREATEPIPE; break; }
168
+    if(!DuplicateHandle(GetCurrentProcess(), hOutputWrite, GetCurrentProcess(),
169
+      
170
+      /* duplicates handles and makes them inheritable */
171
+      &hErrorWrite, 0, TRUE, DUPLICATE_SAME_ACCESS) ||
172
+      !DuplicateHandle(GetCurrentProcess(), hOutputReadTmp, GetCurrentProcess(),
173
+      &hOutputRead, 0, FALSE, DUPLICATE_SAME_ACCESS) ||
174
+      !DuplicateHandle(GetCurrentProcess(), hInputWriteTmp, GetCurrentProcess(),
175
+      &hInputWrite, 0, FALSE, DUPLICATE_SAME_ACCESS))
176
+    { rslt = ERR_DUPHANDLE; break; }
177
+    
178
+    /* run process and close unnecessary handles */
179
+    psi->cb = sizeof(STARTUPINFO);
180
+    psi->dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
181
+    psi->hStdOutput = hOutputWrite;
182
+    psi->hStdInput  = hInputRead;
183
+    psi->hStdError  = hErrorWrite;
184
+    psi->wShowWindow = SW_HIDE; /* SW_NORMAL - for tests */
185
+    if(!CreateProcess(NULL, ptp->dosExec, NULL, NULL, TRUE, 0, NULL, NULL, psi, &pi))
186
+    { rslt = ERR_CREATEPROC; break; }
187
+    
188
+    /* closes temporary and unnesessery handles */
189
+    if(!CloseHandle(hOutputReadTmp) ||
190
+      !CloseHandle(hInputWriteTmp) ||
191
+      !CloseHandle(pi.hThread) ||
192
+      !CloseHandle(hOutputWrite) ||
193
+      !CloseHandle(hInputRead ) ||
194
+      !CloseHandle(hErrorWrite))
195
+    { rslt = ERR_CLOSEHANDLE; break; }
196
+    
197
+    /* write all to pipe - on tests it caches input strings correctly */
198
+    if(iPipeWrite > 0)
199
+    {
200
+#ifdef UNICODE
201
+			int cbConverted = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ptp->pipeWrite, iPipeWrite, NULL, 0, NULL, NULL);
202
+			rslt = -1;
203
+			if (cbConverted > 0)
204
+			{
205
+				PCHAR pszConverted = (PCHAR)GlobalAlloc(GPTR, cbConverted + 1);
206
+				if (pszConverted)
207
+				{
208
+					if (WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ptp->pipeWrite, iPipeWrite, pszConverted, cbConverted, NULL, NULL) > 0)
209
+						WriteFile(hInputWrite, pszConverted, cbConverted, &rslt, NULL);
210
+					GlobalFree(pszConverted);
211
+				}
212
+			}
213
+      if(
214
+#else
215
+      if(WriteFile(hInputWrite, ptp->pipeWrite, iPipeWrite, &rslt, NULL) == 0 ||
216
+#endif
217
+        rslt != (unsigned)iPipeWrite)
218
+      { rslt = ERR_WRITEPIPE; break; }
219
+      FlushFileBuffers(hInputWrite);
220
+    }
221
+    
222
+    /* open log file if name is correct */
223
+    if(ptp->target == OUT_FILE &&
224
+      *(ptp->logFile) != 0 &&
225
+      (f = CreateFile(ptp->logFile, GENERIC_WRITE, FILE_SHARE_READ, NULL,
226
+      CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)
227
+    { rslt = ERR_LOGOPEN; break; }
228
+    
229
+    /* OK, this is main execution loop */
230
+    while(waitTime <= ptp->timeout &&
231
+      rslt != ERR_LOGWRITE &&
232
+      PeekNamedPipe(hOutputRead, 0, 0, 0, &dwRead, NULL) &&
233
+      GetExitCodeProcess(pi.hProcess, &rslt))
234
+    {
235
+      if(dwRead > 0)
236
+      {
237
+        if(ReadFile(hOutputRead, b, dwRead > sizeof(b) ? sizeof(b) : dwRead, &rslt, NULL) &&
238
+          rslt > 0)
239
+        {
240
+          if(ptp->target == OUT_FILE)
241
+          {
242
+            if(f != INVALID_HANDLE_VALUE &&
243
+              (WriteFile(f, b, rslt, &dwRead, NULL) == 0 || dwRead != rslt))
244
+            {
245
+              rslt = ERR_LOGWRITE;
246
+              break;
247
+            }
248
+          }
249
+          else
250
+          {
251
+            dwRead = 0;
252
+            while(dwRead < rslt)
253
+            {
254
+              if(b[dwRead] == TEXT('\n'))
255
+              {
256
+                /* supress empty lines */
257
+                if(iStack > 0)
258
+                {
259
+                  szStack[iStack] = 0;
260
+                  if(ptp->target == OUT_STACK)
261
+                    pushstring(szStack);
262
+                  else if(ptp->target == OUT_FUNCTION)
263
+                  {
264
+                    pushstring(szStack);
265
+                    ep->ExecuteCodeSegment(ptp->lFuncAddress-1, 0);
266
+                  }
267
+                  else if(lstrcmpi(ptp->logFile, TEXT("SysListView32")) == 0)
268
+                  {
269
+                    lvItem.iItem = (int)SendMessage(ptp->hOut, LVM_GETITEMCOUNT, 0, 0);
270
+                    lvItem.iItem = (int)SendMessage(ptp->hOut, LVM_INSERTITEM, 0,  (LPARAM)&lvItem);
271
+                    SendMessage(ptp->hOut, LVM_ENSUREVISIBLE, lvItem.iItem,  0);
272
+                  }
273
+                  else if(lstrcmpi(ptp->logFile, TEXT("Edit")) == 0 || lstrcmpi(ptp->logFile, TEXT("RichEdit20A")) == 0)
274
+                  {
275
+                    lstrcat(szStack, TEXT("\r\n"));
276
+                    lvItem.iItem = (int)SendMessage(ptp->hOut, WM_GETTEXTLENGTH, 0, 0);
277
+                    SendMessage(ptp->hOut, EM_SETSEL, lvItem.iItem, lvItem.iItem);
278
+                    SendMessage(ptp->hOut, EM_REPLACESEL, 0,  (LPARAM)szStack);
279
+                  }
280
+                  else if(lstrcmpi(ptp->logFile, TEXT("ListBox")) == 0)
281
+                  {
282
+                    lvItem.iItem = (int)SendMessage(ptp->hOut, LB_GETCOUNT, 0, 0);
283
+                    lvItem.iItem = (int)SendMessage(ptp->hOut, LB_INSERTSTRING, lvItem.iItem,  (LPARAM)szStack);
284
+                    //SendMessage(ptp->hOut, LVM_ENSUREVISIBLE, lvItem.iItem,  0);
285
+                  }
286
+                  iStack = 0;
287
+                }
288
+              }
289
+              else if(b[dwRead] != TEXT('\r') && iStack < (g_stringsize-1))
290
+              {
291
+                szStack[iStack++] = b[dwRead];
292
+              }
293
+              dwRead++;
294
+            }
295
+          }
296
+        }
297
+        if(f != INVALID_HANDLE_VALUE)
298
+          FlushFileBuffers(f);
299
+      }
300
+      else if(rslt == STILL_ACTIVE)
301
+      {
302
+        Sleep(SLEEP_MS);
303
+        waitTime += SLEEP_MS;
304
+      }
305
+      else break;
306
+    }
307
+    if(iStack > 0)
308
+    {
309
+      szStack[iStack] = 0;
310
+      pushstring(szStack);
311
+    }
312
+    if(f != INVALID_HANDLE_VALUE) CloseHandle(f);
313
+    
314
+    if(GetExitCodeProcess(pi.hProcess, &rslt))
315
+    {
316
+      if(rslt == STILL_ACTIVE)
317
+      {
318
+        TerminateProcess(pi.hProcess, -1);
319
+        rslt = ERR_TERMINATED;
320
+      }
321
+    }
322
+    else rslt = ERR_GETEXITCODE;
323
+    CloseHandle(pi.hProcess);
324
+    CloseHandle(hOutputRead);
325
+    CloseHandle(hInputWrite);
326
+    break;
327
+  }
328
+  
329
+  GlobalFree(psi);
330
+  GlobalFree(ptp->dosExec);
331
+  GlobalFree(ptp->pipeWrite);
332
+  GlobalFree(ptp->logFile);
333
+  GlobalFree(ptp);
334
+  if(szStack) GlobalFree(szStack);
335
+
336
+  if (ptp->lEndFuncAddress != -1)
337
+    ep->ExecuteCodeSegment(ptp->lEndFuncAddress - 1, 0);
338
+
339
+  return (DWORD)rslt;
340
+}
341
+
342
+/*****************************************************
343
+ * FUNCTION NAME: PluginCallback()
344
+ * PURPOSE: 
345
+ *   for NSIS plugin API
346
+ *****************************************************/
347
+static UINT_PTR PluginCallback(enum NSPIM msg)
348
+{
349
+  return 0;
350
+}
351
+
352
+/*****************************************************
353
+ * FUNCTION NAME: wait()
354
+ * PURPOSE: 
355
+ *   waits for thread exit and closes handle
356
+ * SPECIAL CONSIDERATIONS:
357
+ *   tested with my consApp.exe
358
+ *****************************************************/
359
+NSISFUNC(wait)
360
+{
361
+  DWORD rslt = ERR_CREATETHREAD;
362
+  TCHAR exitCode[16];
363
+  HANDLE hThread;
364
+
365
+  popstring(exitCode);
366
+  hThread = (HANDLE)myatou(exitCode);
367
+/* push to stack application' exit code or -1 or "still_running" */
368
+  if(hThread != NULL)
369
+  {
370
+    WaitForSingleObject(hThread, INFINITE);
371
+    GetExitCodeThread(hThread, &rslt);
372
+    CloseHandle(hThread);
373
+    hThread = NULL;
374
+  }
375
+  wsprintf(exitCode, TEXT("%d"), rslt);
376
+  pushstring(exitCode);
377
+}
378
+
379
+/*****************************************************
380
+ * FUNCTION NAME: isdone()
381
+ * PURPOSE: 
382
+ *   checks if the thread has completed
383
+ * SPECIAL CONSIDERATIONS:
384
+ *   
385
+ *****************************************************/
386
+NSISFUNC(isdone)
387
+{
388
+  TCHAR s[16];
389
+  HANDLE hThread;
390
+
391
+// get thread handle from stack
392
+  popstring(s);
393
+  hThread = (HANDLE)myatou(s);
394
+// is it running? 1 == yes, 0 == exited, -1 == error 
395
+  if(hThread != NULL)
396
+    pushstring(WaitForSingleObject(hThread, 0) == WAIT_TIMEOUT ? TEXT("0") : TEXT("1"));
397
+  else
398
+    pushstring(TEXT("-1"));
399
+}
400
+
401
+/*****************************************************
402
+ * FUNCTION NAME: exec()
403
+ * PURPOSE: 
404
+ *   C dll entry point for hidden DOS process execution
405
+ * SPECIAL CONSIDERATIONS:
406
+ *
407
+ *****************************************************/
408
+NSISFUNC(exec)
409
+{
410
+  DWORD dwThreadId;
411
+  HANDLE hThread;
412
+  BOOL fWait = TRUE;
413
+  pthreadParams ptp = (pthreadParams)GlobalAlloc(GPTR, sizeof(threadParams));
414
+  TCHAR s[16];
415
+  TCHAR *p;
416
+  HWND childwnd;
417
+
418
+  ep = extra;
419
+  EXDLL_INIT();
420
+
421
+  ptp->dosExec = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));
422
+  ptp->pipeWrite = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));
423
+  ptp->logFile = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));
424
+  ptp->timeout = 0xffffff;
425
+  ptp->lEndFuncAddress = -1;
426
+  ptp->disableFsR = FALSE;
427
+
428
+  while(!popstring(ptp->dosExec) && *(ptp->dosExec) == TEXT('/'))
429
+  {
430
+    if(lstrcmpi(ptp->dosExec, N_W) == 0)
431
+    {
432
+      fWait = FALSE;
433
+    }
434
+    else if(lstrcmpi(ptp->dosExec, DISABLEFSR) == 0)
435
+    {
436
+      ptp->disableFsR = TRUE;
437
+    }
438
+    else if(lstrcmpi(ptp->dosExec, TOSTACK) == 0)
439
+    {
440
+      ptp->target = OUT_STACK;
441
+    }
442
+    else if(lstrcmpi(ptp->dosExec, TOWINDOW) == 0)
443
+    {
444
+      ptp->target = OUT_WINDOW;
445
+    }
446
+    else if(lstrcmpi(ptp->dosExec, TOFUNC) == 0)
447
+    {
448
+      ptp->target = OUT_FUNCTION;
449
+    }
450
+    else if(lstrcmpi(ptp->dosExec, DETAILED) == 0)
451
+    {
452
+// convert 'detailed' to 'window' option
453
+      ptp->target = OUT_WINDOW;
454
+      if(hWndParent &&
455
+        (childwnd = FindWindowEx(hWndParent, NULL, TEXT("#32770"), NULL)) != NULL)
456
+        wsprintf(ptp->logFile, TEXT("%d"), (int)GetDlgItem(childwnd, 0x3f8));
457
+    }
458
+    else if((p = my_strchr(ptp->dosExec, TEXT('='))) != NULL)
459
+    {
460
+      *p++ = 0;
461
+      if(lstrcmpi(ptp->dosExec, T_O) == 0)
462
+        ptp->timeout = myatou(p);
463
+      else if(lstrcmpi(ptp->dosExec, ENDFUNC) == 0)
464
+        ptp->lEndFuncAddress = myatou(p);
465
+    }
466
+    *(ptp->dosExec) = 0;
467
+  }
468
+
469
+// if stack is not empty and no /tostack or /detailed output option
470
+  if(popstring(ptp->pipeWrite) == 0 &&
471
+    *ptp->logFile == 0 && // may be in use by DETAILED window
472
+    ptp->target != OUT_STACK) // 2 param suposed only
473
+    popstring(ptp->logFile);
474
+// output window was kept in string. Let's handle it once
475
+  if(ptp->target == OUT_WINDOW)
476
+  {
477
+    ptp->hOut = (HWND)myatou(ptp->logFile);
478
+    GetClassName(ptp->hOut, ptp->logFile, string_size);
479
+  }
480
+  if(ptp->target == OUT_FUNCTION)
481
+  {
482
+    ptp->lFuncAddress = (LONG)myatou(ptp->logFile);
483
+  }
484
+
485
+  hThread = CreateThread(NULL, 0, redirect, ptp, 0, &dwThreadId);
486
+  wsprintf(s, TEXT("%u"), hThread);
487
+  pushstring(s);
488
+
489
+  if(fWait)
490
+    wait(hWndParent, string_size, variables, stacktop, extra);
491
+  else
492
+    extra->RegisterPluginCallback((HMODULE)g_hInstance, PluginCallback);
493
+}
494
+
495
+/*****************************************************
496
+ * FUNCTION NAME: DllMain()
497
+ * PURPOSE: 
498
+ *   Dll main entry point
499
+ * SPECIAL CONSIDERATIONS:
500
+ *   
501
+ *****************************************************/
502
+BOOL WINAPI DllMain(HANDLE hInst,
503
+              ULONG ul_reason_for_call,
504
+              LPVOID lpReserved)
505
+{
506
+  g_hInstance = hInst;
507
+  return TRUE;
508
+}

BIN
Windows/NSIS/Contrib/ExecDos/execDos.rc View File


+ 229
- 0
Windows/NSIS/Contrib/ExecDos/nsis_tchar.h View File

@@ -0,0 +1,229 @@
1
+/*
2
+ * nsis_tchar.h
3
+ * 
4
+ * This file is a part of NSIS.
5
+ * 
6
+ * Copyright (C) 1999-2013 Nullsoft and Contributors
7
+ * 
8
+ * This software is provided 'as-is', without any express or implied
9
+ * warranty.
10
+ *
11
+ * For Unicode support by Jim Park -- 08/30/2007
12
+ */
13
+
14
+// Jim Park: Only those we use are listed here.
15
+
16
+#pragma once
17
+
18
+#ifdef _UNICODE
19
+
20
+#ifndef _T
21
+#define __T(x)   L ## x
22
+#define _T(x)    __T(x)
23
+#define _TEXT(x) __T(x)
24
+#endif
25
+
26
+#ifndef _TCHAR_DEFINED
27
+#define _TCHAR_DEFINED
28
+#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)
29
+typedef unsigned short TCHAR;
30
+#else
31
+typedef wchar_t TCHAR;
32
+#endif
33
+#endif
34
+
35
+
36
+// program
37
+#define _tenviron   _wenviron
38
+#define __targv     __wargv
39
+
40
+// printfs
41
+#define _ftprintf   fwprintf
42
+#define _sntprintf  _snwprintf
43
+#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__)
44
+#	define _stprintf   swprintf
45
+#else
46
+#	define _stprintf   _swprintf
47
+#endif
48
+#define _tprintf    wprintf
49
+#define _vftprintf  vfwprintf
50
+#define _vsntprintf _vsnwprintf
51
+#if defined(_MSC_VER) && (_MSC_VER<=1310)
52
+#	define _vstprintf  vswprintf
53
+#else
54
+#	define _vstprintf  _vswprintf
55
+#endif
56
+
57
+// scanfs
58
+#define _tscanf     wscanf
59
+#define _stscanf    swscanf
60
+
61
+// string manipulations
62
+#define _tcscat     wcscat
63
+#define _tcschr     wcschr
64
+#define _tcsclen    wcslen
65
+#define _tcscpy     wcscpy
66
+#define _tcsdup     _wcsdup
67
+#define _tcslen     wcslen
68
+#define _tcsnccpy   wcsncpy
69
+#define _tcsncpy    wcsncpy
70
+#define _tcsrchr    wcsrchr
71
+#define _tcsstr     wcsstr
72
+#define _tcstok     wcstok
73
+
74
+// string comparisons
75
+#define _tcscmp     wcscmp
76
+#define _tcsicmp    _wcsicmp
77
+#define _tcsncicmp  _wcsnicmp
78
+#define _tcsncmp    wcsncmp
79
+#define _tcsnicmp   _wcsnicmp
80
+
81
+// upper / lower
82
+#define _tcslwr     _wcslwr
83
+#define _tcsupr     _wcsupr
84
+#define _totlower   towlower
85
+#define _totupper   towupper
86
+
87
+// conversions to numbers
88
+#define _tcstoi64   _wcstoi64
89
+#define _tcstol     wcstol
90
+#define _tcstoul    wcstoul
91
+#define _tstof      _wtof
92
+#define _tstoi      _wtoi
93
+#define _tstoi64    _wtoi64
94
+#define _ttoi       _wtoi
95
+#define _ttoi64     _wtoi64
96
+#define _ttol       _wtol
97
+
98
+// conversion from numbers to strings
99
+#define _itot       _itow
100
+#define _ltot       _ltow
101
+#define _i64tot     _i64tow
102
+#define _ui64tot    _ui64tow
103
+
104
+// file manipulations
105
+#define _tfopen     _wfopen
106
+#define _topen      _wopen
107
+#define _tremove    _wremove
108
+#define _tunlink    _wunlink
109
+
110
+// reading and writing to i/o
111
+#define _fgettc     fgetwc
112
+#define _fgetts     fgetws
113
+#define _fputts     fputws
114
+#define _gettchar   getwchar
115
+
116
+// directory
117
+#define _tchdir     _wchdir
118
+
119
+// environment
120
+#define _tgetenv    _wgetenv
121
+#define _tsystem    _wsystem
122
+
123
+// time
124
+#define _tcsftime   wcsftime
125
+
126
+#else // ANSI
127
+
128
+#ifndef _T
129
+#define _T(x)    x
130
+#define _TEXT(x) x
131
+#endif
132
+
133
+#ifndef _TCHAR_DEFINED
134
+#define _TCHAR_DEFINED
135
+typedef char TCHAR;
136
+#endif
137
+
138
+// program
139
+#define _tenviron   environ
140
+#define __targv     __argv
141
+
142
+// printfs
143
+#define _ftprintf   fprintf
144
+#define _sntprintf  _snprintf
145
+#define _stprintf   sprintf
146
+#define _tprintf    printf
147
+#define _vftprintf  vfprintf
148
+#define _vsntprintf _vsnprintf
149
+#define _vstprintf  vsprintf
150
+
151
+// scanfs
152
+#define _tscanf     scanf
153
+#define _stscanf    sscanf
154
+
155
+// string manipulations
156
+#define _tcscat     strcat
157
+#define _tcschr     strchr
158
+#define _tcsclen    strlen
159
+#define _tcscnlen   strnlen
160
+#define _tcscpy     strcpy
161
+#define _tcsdup     _strdup
162
+#define _tcslen     strlen
163
+#define _tcsnccpy   strncpy
164
+#define _tcsrchr    strrchr
165
+#define _tcsstr     strstr
166
+#define _tcstok     strtok
167
+
168
+// string comparisons
169
+#define _tcscmp     strcmp
170
+#define _tcsicmp    _stricmp
171
+#define _tcsncmp    strncmp
172
+#define _tcsncicmp  _strnicmp
173
+#define _tcsnicmp   _strnicmp
174
+
175
+// upper / lower
176
+#define _tcslwr     _strlwr
177
+#define _tcsupr     _strupr
178
+
179
+#define _totupper   toupper
180
+#define _totlower   tolower
181
+
182
+// conversions to numbers
183
+#define _tcstol     strtol
184
+#define _tcstoul    strtoul
185
+#define _tstof      atof
186
+#define _tstoi      atoi
187
+#define _tstoi64    _atoi64
188
+#define _tstoi64    _atoi64
189
+#define _ttoi       atoi
190
+#define _ttoi64     _atoi64
191
+#define _ttol       atol
192
+
193
+// conversion from numbers to strings
194
+#define _i64tot     _i64toa
195
+#define _itot       _itoa
196
+#define _ltot       _ltoa
197
+#define _ui64tot    _ui64toa
198
+
199
+// file manipulations
200
+#define _tfopen     fopen
201
+#define _topen      _open
202
+#define _tremove    remove
203
+#define _tunlink    _unlink
204
+
205
+// reading and writing to i/o
206
+#define _fgettc     fgetc
207
+#define _fgetts     fgets
208
+#define _fputts     fputs
209
+#define _gettchar   getchar
210
+
211
+// directory
212
+#define _tchdir     _chdir
213
+
214
+// environment
215
+#define _tgetenv    getenv
216
+#define _tsystem    system
217
+
218
+// time
219
+#define _tcsftime   strftime
220
+
221
+#endif
222
+
223
+// is functions (the same in Unicode / ANSI)
224
+#define _istgraph   isgraph
225
+#define _istascii   __isascii
226
+
227
+#define __TFILE__ _T(__FILE__)
228
+#define __TDATE__ _T(__DATE__)
229
+#define __TTIME__ _T(__TIME__)

+ 294
- 0
Windows/NSIS/Contrib/ExecDos/pluginapi.c View File

@@ -0,0 +1,294 @@
1
+#include <windows.h>
2
+
3
+#include "pluginapi.h"
4
+
5
+#ifdef _countof
6
+#define COUNTOF _countof
7
+#else
8
+#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
9
+#endif
10
+
11
+unsigned int g_stringsize;
12
+stack_t **g_stacktop;
13
+TCHAR *g_variables;
14
+
15
+// utility functions (not required but often useful)
16
+
17
+int NSISCALL popstring(TCHAR *str)
18
+{
19
+  stack_t *th;
20
+  if (!g_stacktop || !*g_stacktop) return 1;
21
+  th=(*g_stacktop);
22
+  if (str) lstrcpy(str,th->text);
23
+  *g_stacktop = th->next;
24
+  GlobalFree((HGLOBAL)th);
25
+  return 0;
26
+}
27
+
28
+int NSISCALL popstringn(TCHAR *str, int maxlen)
29
+{
30
+  stack_t *th;
31
+  if (!g_stacktop || !*g_stacktop) return 1;
32
+  th=(*g_stacktop);
33
+  if (str) lstrcpyn(str,th->text,maxlen?maxlen:g_stringsize);
34
+  *g_stacktop = th->next;
35
+  GlobalFree((HGLOBAL)th);
36
+  return 0;
37
+}
38
+
39
+void NSISCALL pushstring(const TCHAR *str)
40
+{
41
+  stack_t *th;
42
+  if (!g_stacktop) return;
43
+  th=(stack_t*)GlobalAlloc(GPTR,(sizeof(stack_t)+(g_stringsize)*sizeof(TCHAR)));
44
+  lstrcpyn(th->text,str,g_stringsize);
45
+  th->next=*g_stacktop;
46
+  *g_stacktop=th;
47
+}
48
+
49
+TCHAR* NSISCALL getuservariable(const int varnum)
50
+{
51
+  if (varnum < 0 || varnum >= __INST_LAST) return NULL;
52
+  return g_variables+varnum*g_stringsize;
53
+}
54
+
55
+void NSISCALL setuservariable(const int varnum, const TCHAR *var)
56
+{
57
+	if (var != NULL && varnum >= 0 && varnum < __INST_LAST) 
58
+		lstrcpy(g_variables + varnum*g_stringsize, var);
59
+}
60
+
61
+#ifdef _UNICODE
62
+int NSISCALL PopStringA(char* ansiStr)
63
+{
64
+   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));
65
+   int rval = popstring(wideStr);
66
+   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
67
+   GlobalFree((HGLOBAL)wideStr);
68
+   return rval;
69
+}
70
+
71
+int NSISCALL PopStringNA(char* ansiStr, int maxlen)
72
+{
73
+   int realLen = maxlen ? maxlen : g_stringsize;
74
+   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, realLen*sizeof(wchar_t));
75
+   int rval = popstringn(wideStr, realLen);
76
+   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, realLen, NULL, NULL);
77
+   GlobalFree((HGLOBAL)wideStr);
78
+   return rval;
79
+}
80
+
81
+void NSISCALL PushStringA(const char* ansiStr)
82
+{
83
+   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));
84
+   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);
85
+   pushstring(wideStr);
86
+   GlobalFree((HGLOBAL)wideStr);
87
+   return;
88
+}
89
+
90
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)
91
+{
92
+   lstrcpyW(wideStr, getuservariable(varnum));
93
+}
94
+
95
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr)
96
+{
97
+   wchar_t* wideStr = getuservariable(varnum);
98
+   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
99
+}
100
+
101
+void NSISCALL SetUserVariableA(const int varnum, const char* ansiStr)
102
+{
103
+   if (ansiStr != NULL && varnum >= 0 && varnum < __INST_LAST)
104
+   {
105
+      wchar_t* wideStr = g_variables + varnum * g_stringsize;
106
+      MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);
107
+   }
108
+}
109
+
110
+#else
111
+// ANSI defs
112
+int NSISCALL PopStringW(wchar_t* wideStr)
113
+{
114
+   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);
115
+   int rval = popstring(ansiStr);
116
+   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);
117
+   GlobalFree((HGLOBAL)ansiStr);
118
+   return rval;
119
+}
120
+
121
+int NSISCALL PopStringNW(wchar_t* wideStr, int maxlen)
122
+{
123
+   int realLen = maxlen ? maxlen : g_stringsize;
124
+   char* ansiStr = (char*) GlobalAlloc(GPTR, realLen);
125
+   int rval = popstringn(ansiStr, realLen);
126
+   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, realLen);
127
+   GlobalFree((HGLOBAL)ansiStr);
128
+   return rval;
129
+}
130
+
131
+void NSISCALL PushStringW(wchar_t* wideStr)
132
+{
133
+   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);
134
+   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
135
+   pushstring(ansiStr);
136
+   GlobalFree((HGLOBAL)ansiStr);
137
+}
138
+
139
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)
140
+{
141
+   char* ansiStr = getuservariable(varnum);
142
+   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);
143
+}
144
+
145
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr)
146
+{
147
+   lstrcpyA(ansiStr, getuservariable(varnum));
148
+}
149
+
150
+void NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr)
151
+{
152
+   if (wideStr != NULL && varnum >= 0 && varnum < __INST_LAST)
153
+   {
154
+      char* ansiStr = g_variables + varnum * g_stringsize;
155
+      WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
156
+   }
157
+}
158
+#endif
159
+
160
+// playing with integers
161
+
162
+INT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s)
163
+{
164
+  INT_PTR v=0;
165
+  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))
166
+  {
167
+    s++;
168
+    for (;;)
169
+    {
170
+      int c=*(++s);
171
+      if (c >= _T('0') && c <= _T('9')) c-=_T('0');
172
+      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;
173
+      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;
174
+      else break;
175
+      v<<=4;
176
+      v+=c;
177
+    }
178
+  }
179
+  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))
180
+  {
181
+    for (;;)
182
+    {
183
+      int c=*(++s);
184
+      if (c >= _T('0') && c <= _T('7')) c-=_T('0');
185
+      else break;
186
+      v<<=3;
187
+      v+=c;
188
+    }
189
+  }
190
+  else
191
+  {
192
+    int sign=0;
193
+    if (*s == _T('-')) sign++; else s--;
194
+    for (;;)
195
+    {
196
+      int c=*(++s) - _T('0');
197
+      if (c < 0 || c > 9) break;
198
+      v*=10;
199
+      v+=c;
200
+    }
201
+    if (sign) v = -v;
202
+  }
203
+
204
+  return v;
205
+}
206
+
207
+unsigned int NSISCALL myatou(const TCHAR *s)
208
+{
209
+  unsigned int v=0;
210
+
211
+  for (;;)
212
+  {
213
+    unsigned int c=*s++;
214
+    if (c >= _T('0') && c <= _T('9')) c-=_T('0');
215
+    else break;
216
+    v*=10;
217
+    v+=c;
218
+  }
219
+  return v;
220
+}
221
+
222
+int NSISCALL myatoi_or(const TCHAR *s)
223
+{
224
+  int v=0;
225
+  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))
226
+  {
227
+    s++;
228
+    for (;;)
229
+    {
230
+      int c=*(++s);
231
+      if (c >= _T('0') && c <= _T('9')) c-=_T('0');
232
+      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;
233
+      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;
234
+      else break;
235
+      v<<=4;
236
+      v+=c;
237
+    }
238
+  }
239
+  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))
240
+  {
241
+    for (;;)
242
+    {
243
+      int c=*(++s);
244
+      if (c >= _T('0') && c <= _T('7')) c-=_T('0');
245
+      else break;
246
+      v<<=3;
247
+      v+=c;
248
+    }
249
+  }
250
+  else
251
+  {
252
+    int sign=0;
253
+    if (*s == _T('-')) sign++; else s--;
254
+    for (;;)
255
+    {
256
+      int c=*(++s) - _T('0');
257
+      if (c < 0 || c > 9) break;
258
+      v*=10;
259
+      v+=c;
260
+    }
261
+    if (sign) v = -v;
262
+  }
263
+
264
+  // Support for simple ORed expressions
265
+  if (*s == _T('|')) 
266
+  {
267
+      v |= myatoi_or(s+1);
268
+  }
269
+
270
+  return v;
271
+}
272
+
273
+INT_PTR NSISCALL popintptr()
274
+{
275
+  TCHAR buf[128];
276
+  if (popstringn(buf,COUNTOF(buf)))
277
+    return 0;
278
+  return nsishelper_str_to_ptr(buf);
279
+}
280
+
281
+int NSISCALL popint_or()
282
+{
283
+  TCHAR buf[128];
284
+  if (popstringn(buf,COUNTOF(buf)))
285
+    return 0;
286
+  return myatoi_or(buf);
287
+}
288
+
289
+void NSISCALL pushintptr(INT_PTR value)
290
+{
291
+	TCHAR buffer[30];
292
+	wsprintf(buffer, sizeof(void*) > 4 ? _T("%Id") : _T("%d"), value);
293
+	pushstring(buffer);
294
+}

+ 104
- 0
Windows/NSIS/Contrib/ExecDos/pluginapi.h View File

@@ -0,0 +1,104 @@
1
+#ifndef ___NSIS_PLUGIN__H___
2
+#define ___NSIS_PLUGIN__H___
3
+
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
8
+#include "api.h"
9
+#include "nsis_tchar.h"
10
+
11
+#ifndef NSISCALL
12
+#  define NSISCALL __stdcall
13
+#endif
14
+
15
+#define EXDLL_INIT()           {  \
16
+        g_stringsize=string_size; \
17
+        g_stacktop=stacktop;      \
18
+        g_variables=variables; }
19
+
20
+typedef struct _stack_t {
21
+  struct _stack_t *next;
22
+  TCHAR text[1]; // this should be the length of string_size
23
+} stack_t;
24
+
25
+enum
26
+{
27
+INST_0,         // $0
28
+INST_1,         // $1
29
+INST_2,         // $2
30
+INST_3,         // $3
31
+INST_4,         // $4
32
+INST_5,         // $5
33
+INST_6,         // $6
34
+INST_7,         // $7
35
+INST_8,         // $8
36
+INST_9,         // $9
37
+INST_R0,        // $R0
38
+INST_R1,        // $R1
39
+INST_R2,        // $R2
40
+INST_R3,        // $R3
41
+INST_R4,        // $R4
42
+INST_R5,        // $R5
43
+INST_R6,        // $R6
44
+INST_R7,        // $R7
45
+INST_R8,        // $R8
46
+INST_R9,        // $R9
47
+INST_CMDLINE,   // $CMDLINE
48
+INST_INSTDIR,   // $INSTDIR
49
+INST_OUTDIR,    // $OUTDIR
50
+INST_EXEDIR,    // $EXEDIR
51
+INST_LANG,      // $LANGUAGE
52
+__INST_LAST
53
+};
54
+
55
+extern unsigned int g_stringsize;
56
+extern stack_t **g_stacktop;
57
+extern TCHAR *g_variables;
58
+
59
+void NSISCALL pushstring(const TCHAR *str);
60
+void NSISCALL pushintptr(INT_PTR value);
61
+#define pushint(v) pushintptr((INT_PTR)(v))
62
+int NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack
63
+int NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize
64
+INT_PTR NSISCALL popintptr();
65
+#define popint() ( (int) popintptr() )
66
+int NSISCALL popint_or(); // with support for or'ing (2|4|8)
67
+INT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s);
68
+#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer
69
+unsigned int NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only
70
+int NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)
71
+TCHAR* NSISCALL getuservariable(const int varnum);
72
+void NSISCALL setuservariable(const int varnum, const TCHAR *var);
73
+
74
+#ifdef _UNICODE
75
+#define PopStringW(x) popstring(x)
76
+#define PushStringW(x) pushstring(x)
77
+#define SetUserVariableW(x,y) setuservariable(x,y)
78
+
79
+int  NSISCALL PopStringA(char* ansiStr);
80
+void NSISCALL PushStringA(const char* ansiStr);
81
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);
82
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr);
83
+void NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);
84
+
85
+#else
86
+// ANSI defs
87
+
88
+#define PopStringA(x) popstring(x)
89
+#define PushStringA(x) pushstring(x)
90
+#define SetUserVariableA(x,y) setuservariable(x,y)
91
+
92
+int  NSISCALL PopStringW(wchar_t* wideStr);
93
+void NSISCALL PushStringW(wchar_t* wideStr);
94
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);
95
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr);
96
+void NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);
97
+
98
+#endif
99
+
100
+#ifdef __cplusplus
101
+}
102
+#endif
103
+
104
+#endif//!___NSIS_PLUGIN__H___

+ 14
- 0
Windows/NSIS/Contrib/ExecDos/resource.h View File

@@ -0,0 +1,14 @@
1
+//{{NO_DEPENDENCIES}}
2
+// Microsoft Visual C++ generated include file.
3
+// Used by execDos.rc
4
+
5
+// Next default values for new objects
6
+// 
7
+#ifdef APSTUDIO_INVOKED
8
+#ifndef APSTUDIO_READONLY_SYMBOLS
9
+#define _APS_NEXT_RESOURCE_VALUE        101
10
+#define _APS_NEXT_COMMAND_VALUE         40001
11
+#define _APS_NEXT_CONTROL_VALUE         1001
12
+#define _APS_NEXT_SYMED_VALUE           101
13
+#endif
14
+#endif

+ 2
- 0
Windows/NSIS/Contrib/Inetc/afxres.h View File

@@ -0,0 +1,2 @@
1
+#include <windows.h>
2
+#define IDC_STATIC (-1) 

+ 83
- 0
Windows/NSIS/Contrib/Inetc/api.h View File

@@ -0,0 +1,83 @@
1
+/*
2
+ * apih
3
+ * 
4
+ * This file is a part of NSIS.
5
+ * 
6
+ * Copyright (C) 1999-2013 Nullsoft and Contributors
7
+ * 
8
+ * Licensed under the zlib/libpng license (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * 
11
+ * Licence details can be found in the file COPYING.
12
+ * 
13
+ * This software is provided 'as-is', without any express or implied
14
+ * warranty.
15
+ */
16
+
17
+#ifndef _NSIS_EXEHEAD_API_H_
18
+#define _NSIS_EXEHEAD_API_H_
19
+
20
+// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
21
+// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
22
+// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
23
+
24
+#define NSISPIAPIVER_1_0 0x00010000
25
+#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
26
+
27
+// NSIS Plug-In Callback Messages
28
+enum NSPIM 
29
+{
30
+	NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup
31
+	NSPIM_GUIUNLOAD, // Called after .onGUIEnd
32
+};
33
+
34
+// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
35
+// Return NULL for unknown messages
36
+// Should always be __cdecl for future expansion possibilities
37
+typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
38
+
39
+// extra_parameters data structures containing other interesting stuff
40
+// but the stack, variables and HWND passed on to plug-ins.
41
+typedef struct
42
+{
43
+  int autoclose;
44
+  int all_user_var;
45
+  int exec_error;
46
+  int abort;
47
+  int exec_reboot; // NSIS_SUPPORT_REBOOT
48
+  int reboot_called; // NSIS_SUPPORT_REBOOT
49
+  int XXX_cur_insttype; // depreacted
50
+  int plugin_api_version; // see NSISPIAPIVER_CURR
51
+                          // used to be XXX_insttype_changed
52
+  int silent; // NSIS_CONFIG_SILENT_SUPPORT
53
+  int instdir_error;
54
+  int rtl;
55
+  int errlvl;
56
+  int alter_reg_view;
57
+  int status_update;
58
+} exec_flags_t;
59
+
60
+#ifndef NSISCALL
61
+#  define NSISCALL __stdcall
62
+#endif
63
+
64
+typedef struct {
65
+  exec_flags_t *exec_flags;
66
+  int (NSISCALL *ExecuteCodeSegment)(int, HWND);
67
+  void (NSISCALL *validate_filename)(LPTSTR);
68
+  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
69
+} extra_parameters;
70
+
71
+// Definitions for page showing plug-ins
72
+// See Ui.c to understand better how they're used
73
+
74
+// sent to the outer window to tell it to go to the next inner window
75
+#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
76
+
77
+// custom pages should send this message to let NSIS know they're ready
78
+#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
79
+
80
+// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
81
+#define NOTIFY_BYE_BYE 'x'
82
+
83
+#endif /* _PLUGIN_H_ */

+ 105
- 0
Windows/NSIS/Contrib/Inetc/crt.cpp View File

@@ -0,0 +1,105 @@
1
+#include <Windows.h>
2
+
3
+#if defined(_MSC_VER) && _MSC_VER+0 >= 1400
4
+#if defined(_MSC_FULL_VER) && _MSC_FULL_VER+0 >= 140050727
5
+#include <intrin.h>
6
+#else
7
+EXTERN_C void __stosb(BYTE*,BYTE,size_t);
8
+#endif
9
+#pragma intrinsic(__stosb)
10
+#define CRTINTRINSIC_memset(p,c,s) __stosb((BYTE*)(p),(BYTE)(c),(s))
11
+#endif
12
+
13
+extern "C" void* __cdecl memset(void *p, int c, size_t z)
14
+{
15
+#ifdef CRTINTRINSIC_memset
16
+  CRTINTRINSIC_memset(p, c, z);
17
+#else
18
+  BYTE *pb = reinterpret_cast<BYTE*>(p);
19
+  for(size_t i=0; i<z; ++i, ++pb)
20
+    (*pb) = c;
21
+#endif
22
+  return p;
23
+}
24
+
25
+extern "C" const char* __cdecl strstr(const char *str, const char *target)
26
+{
27
+  if (!*target) return (char*)str;
28
+  char *p1 = (char*)str, *p2 = (char*)target;