[r8989]: / ooDialog / examples.package / install / ooDialogExamplesPackage.nsi  Maximize  Restore  History

Download this file

573 lines (463 with data), 22.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
/*----------------------------------------------------------------------------*/
/* */
/* Copyright (c) 2011-2013 Rexx Language Association. All rights reserved. */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the Common Public License v1.0 which accompanies this */
/* distribution. A copy is also available at the following address: */
/* http://www.oorexx.org/license.html */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in */
/* the documentation and/or other materials provided with the distribution. */
/* */
/* Neither the name of Rexx Language Association nor the names */
/* of its contributors may be used to endorse or promote products */
/* derived from this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/*----------------------------------------------------------------------------*/
/**
* ooDialogexamplesPackage.nsi
*
* An NSIS script to build the Extra ooDialog Examples installer.
*
* Use this command line to execute this script:
*
* makensis /DVERSION=n.n.n /DNODOTSVERSION=n_n_n_ /DROOTDIR=<root> /DCPU=x86_64 ooDialogExamplesPackage.nsi
*
*/
;===============================================================================
;Configuration
;===============================================================================
;--------------------------------
; Defines
; define VERSION "0.0.5" defined on command line
; define NODOTSVERSION "0_0_5" defined on command line
!define SHORTNAME "ooDialog_Examples_${NODOTSVERSION}"
!define LONGNAME "Extra ooDialog Samples ${VERSION}"
!define DISPLAYICON "$INSTDIR\AppIcon2.ico"
!define SRCDIR "${ROOTDIR}"
!define UNINSTALLER "uninstall.exe"
;--------------------------------
;Includes
!include "MUI2.nsh"
!include "Library.nsh"
!include "LogicLib.nsh"
!include "FileFunc.nsh"
;--------------------------------
;General
Name "Extra ooDialog Samples"
OutFile "${SHORTNAME}_${CPU}.exe"
ShowInstdetails show
SetOverwrite on
SetPluginUnload alwaysoff
RequestExecutionLevel user
InstallDir "$APPDATA\ooDialog.samples.${VERSION}"
;--------------------------------
;Interface Settings
!define MUI_ICON "AppIcon2.ico"
!define MUI_UNICON "uninstall.ico"
!define MUI_CUSTOMPAGECOMMANDS
!define MUI_WELCOMEFINISHPAGE_BITMAP "orange.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "orange-uninstall.bmp"
!define MUI_LICENSEPAGE
!define MUI_FINISHPAGE
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define UninstLog "uninstall.log"
Var UninstLog
!define SHACF_FILESYSTEM 1 ; For SHAutoComplete()
!macro AddItem Path
FileWrite $UninstLog "${Path}$\r$\n"
!macroend
!define AddItem "!insertmacro AddItem"
!macro File FilePath FileName
FileWrite $UninstLog "$OUTDIR\${FileName}$\r$\n"
File "${FilePath}${FileName}"
!macroend
!define File "!insertmacro File"
!macro CreateDirectory Path
CreateDirectory "${Path}"
FileWrite $UninstLog "${Path}$\r$\n"
!macroend
!define CreateDirectory "!insertmacro CreateDirectory"
!macro SetOutPath Path
SetOutPath "${Path}"
FileWrite $UninstLog "${Path}$\r$\n"
!macroend
!define SetOutPath "!insertmacro SetOutPath"
!macro WriteUninstaller Path
WriteUninstaller "${Path}"
FileWrite $UninstLog "${Path}$\r$\n"
!macroend
!define WriteUninstaller "!insertmacro WriteUninstaller"
;--------------------------------
; Variables
Var RegVal_installedLocation ; Where we are installed
Var DeleteWholeTree ; Delete using log file or by rmdir
Var LogFileExists
; Dialog variables
Var Dialog
Var Delete_ooRexx_Tree_CK
Var Label_One
Var Label_Two
;--------------------------------
; Pages.
;
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "CPLv1.0.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
UninstPage custom un.Uninstall_By_Log_page un.Uninstall_By_Log_leave
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
; Languages
!insertmacro MUI_LANGUAGE "English"
;===============================================================================
;Installer Sections
;===============================================================================
;-------------------------------------------------------------------------------
; Hidden section to open the log file
Section -openlogfile
CreateDirectory "$INSTDIR"
IfFileExists "$INSTDIR\${UninstLog}" +3
FileOpen $UninstLog "$INSTDIR\${UninstLog}" w
Goto +4
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
FileOpen $UninstLog "$INSTDIR\${UninstLog}" a
FileSeek $UninstLog 0 END
SectionEnd
Section installFiles
; Set the installation directory:
${SetOutPath} "$INSTDIR"
DetailPrint "******** Extra ooDialog Samples ${VERSION} **********"
${File} "${SRCDIR}\install\" "AppIcon2.ico"
${File} "${SRCDIR}\install\" "CPLv1.0.txt"
${File} "${SRCDIR}\" "makeDLL.ReadMe"
${File} "${SRCDIR}\" "makeDLL.rex"
${File} "${SRCDIR}\" "ReleaseNotes.txt"
${File} "${SRCDIR}\" "Version.txt"
${CreateDirectory} "$INSTDIR\Controls"
${CreateDirectory} "$INSTDIR\Controls\Edit"
${CreateDirectory} "$INSTDIR\Controls\List-box"
${CreateDirectory} "$INSTDIR\Controls\List-view"
${CreateDirectory} "$INSTDIR\Controls\Static"
${CreateDirectory} "$INSTDIR\Dialogs"
${CreateDirectory} "$INSTDIR\Dialogs\simple.dialogs"
${CreateDirectory} "$INSTDIR\Dialogs\useful.dialogs"
${CreateDirectory} "$INSTDIR\Event.Handlers"
${CreateDirectory} "$INSTDIR\Event.Handlers\Edit"
${CreateDirectory} "$INSTDIR\makeDLL.example"
${CreateDirectory} "$INSTDIR\Menus"
${SetOutPath} "$INSTDIR\Controls\Edit\Extended"
${File} "${SRCDIR}\Controls\Edit\Extended\" "EditControlEx.dll"
${File} "${SRCDIR}\Controls\Edit\Extended\" "EditControlEx.h"
${File} "${SRCDIR}\Controls\Edit\Extended\" "EditControlEx.rc"
${File} "${SRCDIR}\Controls\Edit\Extended\" "EditControlEx.rex"
${File} "${SRCDIR}\Controls\Edit\Extended\" "MakeFile"
${File} "${SRCDIR}\Controls\Edit\Extended\" "ReadMe.txt"
${SetOutPath} "$INSTDIR\Controls\Edit\NumberOnly"
${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "CalcMPG.dll"
${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "CalcMPG.h"
${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "CalcMPG.rc"
${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "CalcMPG.rex"
${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "MakeFile"
${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "NumberOnlyEditEx.cls"
${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "ReadMe.txt"
${SetOutPath} "$INSTDIR\Controls\List-box\pop.quiz"
${File} "${SRCDIR}\Controls\List-box\pop.quiz\" "popQuiz.h"
${File} "${SRCDIR}\Controls\List-box\pop.quiz\" "popQuiz.rc"
${File} "${SRCDIR}\Controls\List-box\pop.quiz\" "popQuiz.rex"
${SetOutPath} "$INSTDIR\Controls\List-view\edit.items"
${File} "${SRCDIR}\Controls\List-view\edit.items\" "EditableListView.bmp"
${File} "${SRCDIR}\Controls\List-view\edit.items\" "EditableListView.h"
${File} "${SRCDIR}\Controls\List-view\edit.items\" "EditableListView.rex"
${SetOutPath} "$INSTDIR\Controls\List-view\extended"
${File} "${SRCDIR}\Controls\List-view\extended\" "ListViewEx.dll"
${File} "${SRCDIR}\Controls\List-view\extended\" "ListViewEx.h"
${File} "${SRCDIR}\Controls\List-view\extended\" "ListViewEx.rc"
${File} "${SRCDIR}\Controls\List-view\extended\" "ListViewEx.rex"
${File} "${SRCDIR}\Controls\List-view\extended\" "MakeFile"
${File} "${SRCDIR}\Controls\List-view\extended\" "ReadMe.txt"
${SetOutPath} "$INSTDIR\Controls\List-view\imageLists"
${File} "${SRCDIR}\Controls\List-view\imageLists\" "addListViews.rex"
${File} "${SRCDIR}\Controls\List-view\imageLists\" "Attribution.txt"
${File} "${SRCDIR}\Controls\List-view\imageLists\" "iconList.h"
${File} "${SRCDIR}\Controls\List-view\imageLists\" "iconList.rc"
${File} "${SRCDIR}\Controls\List-view\imageLists\" "iconList_16.bmp"
${File} "${SRCDIR}\Controls\List-view\imageLists\" "iconList_32.bmp"
${SetOutPath} "$INSTDIR\Controls\List-view\transfer.items"
${File} "${SRCDIR}\Controls\List-view\transfer.items\" "propertyValues.rex"
${SetOutPath} "$INSTDIR\Controls\Static"
${File} "${SRCDIR}\Controls\Static\" "shaveIce.ico"
${File} "${SRCDIR}\Controls\Static\" "staticImage.rex"
${SetOutPath} "$INSTDIR\Dialogs\application.icon"
${File} "${SRCDIR}\Dialogs\application.icon\" "ApplicationIcon.dll"
${File} "${SRCDIR}\Dialogs\application.icon\" "ApplicationIcon.h"
${File} "${SRCDIR}\Dialogs\application.icon\" "ApplicationIcon.rc"
${File} "${SRCDIR}\Dialogs\application.icon\" "Camera.ico"
${File} "${SRCDIR}\Dialogs\application.icon\" "MakeFile"
${File} "${SRCDIR}\Dialogs\application.icon\" "Question32.ico"
${File} "${SRCDIR}\Dialogs\application.icon\" "RcAppIcon.rex"
${File} "${SRCDIR}\Dialogs\application.icon\" "ResAppIcon.rex"
${File} "${SRCDIR}\Dialogs\application.icon\" "UserRcAppIcon.rex"
${File} "${SRCDIR}\Dialogs\application.icon\" "UserRcVariation.rex"
${SetOutPath} "$INSTDIR\Dialogs\color"
${File} "${SRCDIR}\Dialogs\color\" "controlColors.h"
${File} "${SRCDIR}\Dialogs\color\" "controlColors.rc"
${File} "${SRCDIR}\Dialogs\color\" "controlColors.rex"
${SetOutPath} "$INSTDIR\Dialogs\dlgData"
${File} "${SRCDIR}\Dialogs\dlgData\" "dlgData.h"
${File} "${SRCDIR}\Dialogs\dlgData\" "dlgData.rc"
${File} "${SRCDIR}\Dialogs\dlgData\" "dlgData.rex"
${File} "${SRCDIR}\Dialogs\dlgData\" "symbolicDlgData.rex"
${SetOutPath} "$INSTDIR\Dialogs\progress.indicator"
${File} "${SRCDIR}\Dialogs\progress.indicator\" "ProgressDialog.cls"
${File} "${SRCDIR}\Dialogs\progress.indicator\" "progressProgram.rex"
${SetOutPath} "$INSTDIR\Dialogs\simple.dialogs\fileName"
${File} "${SRCDIR}\Dialogs\simple.dialogs\fileName\" "fileNameDialog.rex"
${SetOutPath} "$INSTDIR\Dialogs\simple.dialogs\input"
${File} "${SRCDIR}\Dialogs\simple.dialogs\input\" "inputDlg.rex"
${SetOutPath} "$INSTDIR\Dialogs\simple.dialogs\jobConsole"
${File} "${SRCDIR}\Dialogs\simple.dialogs\jobConsole\" "guiConsole.h"
${File} "${SRCDIR}\Dialogs\simple.dialogs\jobConsole\" "guiConsole.rc"
${File} "${SRCDIR}\Dialogs\simple.dialogs\jobConsole\" "jobConsole.rex"
${SetOutPath} "$INSTDIR\Dialogs\simple.dialogs\typingTutor"
${File} "${SRCDIR}\Dialogs\simple.dialogs\typingTutor\" "typingTutor.rex"
${File} "${SRCDIR}\Dialogs\simple.dialogs\typingTutor\" "typingTutor.h"
${File} "${SRCDIR}\Dialogs\simple.dialogs\typingTutor\" "typingTutor.rc"
${SetOutPath} "$INSTDIR\Dialogs\useful.dialogs\PickOne"
${File} "${SRCDIR}\Dialogs\useful.dialogs\PickOne\" "pickAnInterpreter.rex"
${File} "${SRCDIR}\Dialogs\useful.dialogs\PickOne\" "PickOneDlg.cls"
${SetOutPath} "$INSTDIR\Event.Handlers\Edit\LostFocus"
${File} "${SRCDIR}\Event.Handlers\Edit\LostFocus\" "voterDlg.h"
${File} "${SRCDIR}\Event.Handlers\Edit\LostFocus\" "voterDlg.rc"
${File} "${SRCDIR}\Event.Handlers\Edit\LostFocus\" "voterDlg.rex"
${SetOutPath} "$INSTDIR\makeDLL.example"
${File} "${SRCDIR}\makeDLL.example\" "AnimalGame.h"
${File} "${SRCDIR}\makeDLL.example\" "AnimalGame.rc"
${File} "${SRCDIR}\makeDLL.example\" "AnimalGame.rex"
${File} "${SRCDIR}\makeDLL.example\" "chihuahu.bmp"
${File} "${SRCDIR}\makeDLL.example\" "clap.wav"
${File} "${SRCDIR}\makeDLL.example\" "eleph2.bmp"
${File} "${SRCDIR}\makeDLL.example\" "elephant.wav"
${File} "${SRCDIR}\makeDLL.example\" "goat.bmp"
${File} "${SRCDIR}\makeDLL.example\" "goat.wav"
${File} "${SRCDIR}\makeDLL.example\" "guess.wav"
${File} "${SRCDIR}\makeDLL.example\" "help.wav"
${File} "${SRCDIR}\makeDLL.example\" "horse.bmp"
${File} "${SRCDIR}\makeDLL.example\" "horse.wav"
${File} "${SRCDIR}\makeDLL.example\" "kanguru.bmp"
${File} "${SRCDIR}\makeDLL.example\" "moose.bmp"
${File} "${SRCDIR}\makeDLL.example\" "moose.wav"
${File} "${SRCDIR}\makeDLL.example\" "nope.wav"
${File} "${SRCDIR}\makeDLL.example\" "ReadMe.first"
${File} "${SRCDIR}\makeDLL.example\" "rhino.wav"
${File} "${SRCDIR}\makeDLL.example\" "rhinoce.bmp"
${File} "${SRCDIR}\makeDLL.example\" "sealion.bmp"
${File} "${SRCDIR}\makeDLL.example\" "sealion.wav"
${File} "${SRCDIR}\makeDLL.example\" "tiger.bmp"
${File} "${SRCDIR}\makeDLL.example\" "tiger.wav"
${File} "${SRCDIR}\makeDLL.example\" "yourgood.wav"
; Write the uninstall keys.
DetailPrint "Writing uninstall keys."
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "InstallLocation" '"$INSTDIR"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "DisplayName" "${LONGNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "DisplayIcon" "${DISPLAYICON}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "HelpLink" "http://www.oorexx.org/support.html"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "URLUpdateInfo" "http://sourceforge.net/project/showfiles.php?group_id=119701"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "URLInfoAbout" "http://www.rexxla.org/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "Publisher" "Rexx Language Association"
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "UninstallString" '"$INSTDIR\${UNINSTALLER}"'
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "UnInstallLocation" "$INSTDIR" ; dont quote it
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "UninstallVersion" "${VERSION}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "NoModify" 0x00000001
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "NoRepair" 0x00000001
WriteUninstaller "$INSTDIR\${UNINSTALLER}"
SectionEnd
;===============================================================================
;Installer Functions
;===============================================================================
/** .onInit() Call back function
*
* Called by the installer before any page is shown. We use it to ?
*/
Function .onInit
FunctionEnd
;===============================================================================
; Uninstaller portion of ooDialogSamplesPackage.nsi.
;===============================================================================
;===============================================================================
; Uninstaller Sections
;===============================================================================
;-------------------------------------------------------------------------------
; Uninstall section
Section "Uninstall"
DetailPrint "Removing registry keys set when installing ${LONGNAME}."
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}"
DeleteRegKey HKLM "SOFTWARE\${SHORTNAME}"
Call un.Delete_Installed_Files
SectionEnd
;===============================================================================
; Uninstaller Functions
;===============================================================================
/** un.onInit() Callback function.
*
* Called by the uninstaller program before any pages are shown.
*
*/
Function un.onInit
ReadRegStr $RegVal_installedLocation HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "UnInstallLocation"
StrCpy $DeleteWholeTree 'false'
FunctionEnd
/** un.Uninstall_By_Log_page() Custom page function.
*
* This is a custom page that follows the page that checks if it is okay to
* stop rxapi. Here we check for the uninstall log. We then give the user the
* option of simply deleting the ooRexx directory tree (50 times faster on my
* system) or using the log file to individually delete only the install files.
*
* If the uninstall log is missing, the user does not have the option of
* deleting individual files and directories.
*/
Function un.Uninstall_By_Log_page
StrCpy $LogFileExists 'false'
IfFileExists "$INSTDIR\${UninstLog}" 0 +4
StrCpy $LogFileExists 'true'
${if} $LogFileExists == 'false'
!insertmacro MUI_HEADER_TEXT \
"${UninstLog} NOT found." \
"The option of only removing files installed by the prior ooRexx installer is not available."
StrCpy $0 \
"Because the ${UninstLog} file is missing, the uninstall process must remove all \
files in the $INSTDIR directory tree.$\n$\n\
WARNING: This will remove all folders and files in the $INSTDIR folder, including \
any folders or files not placed there by the original installation.$\n$\n\
If there are any personl folders or files in the $INSTDIR directory tree that need \
to be saved, please cancel the uninstall, move the files, and restart the uninstall \
program."
${else}
!insertmacro MUI_HEADER_TEXT \
"Choose the method for removing installed files." \
"Delete only installed files or delete entire directory tree?"
StrCpy $0 \
"The uninstall program can use an install log to delete only the folders and files \
placed in the $INSTDIR directory tree by the original installation program.$\n$\n\
Optionally, the entire $INSTDIR directory tree can be deleted.$\n$\n\
WARNING: Deleting the entire directory tree will remove all folders and files in the \
$INSTDIR folder. This will include any folders or files not placed there by the \
installation."
${endif}
nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog
${If} $Dialog == error
Abort
${endif}
${if} $LogFileExists == 'false'
${NSD_CreateLabel} 0 0 100% 80u $0
Pop $Label_One
${NSD_CreateCheckBox} 0 84u 100% 8u "Delete entire directory tree"
Pop $Delete_ooRexx_Tree_CK
${NSD_Check} $Delete_ooRexx_Tree_CK
EnableWindow $Delete_ooRexx_Tree_CK 0
${else}
${NSD_CreateLabel} 0 0 100% 84u $0
Pop $Label_One
${NSD_CreateLabel} 0 92u 100% 16u "To DELETE the entire $INSTDIR directory tree, check the check box."
Pop $Label_Two
${NSD_CreateCheckBox} 0 116u 100% 8u "Delete entire directory tree"
Pop $Delete_ooRexx_Tree_CK
${endif}
; Set focus to the page dialog rather than the installer dialog, set focus to
; the check box, and then show the page dialog
SendMessage $Dialog ${WM_SETFOCUS} $HWNDPARENT 0
SendMessage $Dialog ${WM_NEXTDLGCTL} $Delete_ooRexx_Tree_CK 1
nsDialogs::Show
FunctionEnd
/** un.Uninstall_By_Log_leave() Call back function.
*
* Invoked by the uninstaller when the user clicks Next on the uninstall using
* the log page.
*/
Function un.Uninstall_By_Log_leave
${NSD_GetState} $Delete_ooRexx_Tree_CK $0
${if} $0 == 1
StrCpy $DeleteWholeTree 'true'
${else}
StrCpy $DeleteWholeTree 'false'
${endif}
FunctionEnd
/** un.Delete_Installed_Files()
*
* Deletes the installed files in the manner specified by the user. Either by
* using the log file to delete only files installed by the previous
* installaltion or by simply deleting the whole installation directory.
*/
Function un.Delete_Installed_Files
DetailPrint "Deleting ${LONGNAME}"
${if} $DeleteWholeTree == 'true'
DetailPrint "Uninstall files by deleting the $INSTDIR directory tree"
RMDir /r "$INSTDIR"
${else}
DetailPrint "Uninstall files using the install log file"
Push $R0
Push $R1
Push $R2
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
FileOpen $UninstLog "$INSTDIR\${UninstLog}" r
StrCpy $R1 0
GetLineCount:
ClearErrors
FileRead $UninstLog $R0
IntOp $R1 $R1 + 1
IfErrors 0 GetLineCount
LoopRead:
FileSeek $UninstLog 0 SET
StrCpy $R2 0
FindLine:
FileRead $UninstLog $R0
IntOp $R2 $R2 + 1
StrCmp $R1 $R2 0 FindLine
StrCpy $R0 $R0 -2
IfFileExists "$R0\*.*" 0 +3
RMDir $R0 #is dir
Goto +3
IfFileExists $R0 0 +2
Delete $R0 #is file
IntOp $R1 $R1 - 1
StrCmp $R1 0 LoopDone
Goto LoopRead
LoopDone:
FileClose $UninstLog
Delete "$INSTDIR\${UninstLog}"
Delete "$INSTDIR\${UNINSTALLER}"
RMDir "$INSTDIR"
Pop $R2
Pop $R1
Pop $R0
${endif}
FunctionEnd