1 |
joko |
1.1 |
; w2hfax.nsi |
2 |
|
|
; |
3 |
|
|
; This script can install w2hfax and required packages: |
4 |
|
|
; Python 2.4, PythonWin, Redmon, Ghostscript and Ghostview |
5 |
|
|
; has uninstall support and (optionally) installs start menu shortcuts. |
6 |
|
|
; |
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
; -------------------------------- |
11 |
|
|
; The name of the installer |
12 |
|
|
; -------------------------------- |
13 |
|
|
Name "w2hfax" |
14 |
|
|
|
15 |
|
|
; The file to write |
16 |
|
|
OutFile "w2hfax.exe" |
17 |
|
|
|
18 |
|
|
; The default installation directory |
19 |
|
|
InstallDir $PROGRAMFILES\w2hfax-test |
20 |
|
|
|
21 |
|
|
; Registry key to check for directory (so if you install again, it will |
22 |
|
|
; overwrite the old one automatically) |
23 |
|
|
InstallDirRegKey HKLM "Software\NSIS_w2hfax" "Install_Dir" |
24 |
|
|
|
25 |
|
|
Var redmonInstDir |
26 |
|
|
|
27 |
|
|
; -------------------------------- |
28 |
|
|
; Pages |
29 |
|
|
; -------------------------------- |
30 |
|
|
|
31 |
|
|
Page components |
32 |
|
|
Page directory |
33 |
|
|
Page instfiles |
34 |
|
|
|
35 |
|
|
UninstPage uninstConfirm |
36 |
|
|
UninstPage instfiles |
37 |
|
|
|
38 |
|
|
|
39 |
|
|
; -------------------------------- |
40 |
|
|
; The stuff to install |
41 |
|
|
; -------------------------------- |
42 |
|
|
|
43 |
|
|
;Section "w2hfax (required)" |
44 |
|
|
Section "w2hfax" |
45 |
|
|
|
46 |
|
|
SetDetailsPrint both |
47 |
|
|
DetailPrint "Installing w2hfax..." |
48 |
|
|
|
49 |
|
|
;SectionIn RO |
50 |
|
|
|
51 |
|
|
; Set output path to the installation directory. |
52 |
|
|
SetOutPath $INSTDIR |
53 |
|
|
|
54 |
|
|
; Put file there |
55 |
|
|
File "C:\tmp\w2hfax-make\w2hfax\*.*" |
56 |
|
|
|
57 |
|
|
; Write the installation path into the registry |
58 |
|
|
WriteRegStr HKLM SOFTWARE\NSIS_w2hfax "Install_Dir" "$INSTDIR" |
59 |
|
|
|
60 |
|
|
; Write the uninstall keys for Windows |
61 |
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\w2hfax" "DisplayName" "w2hfax" |
62 |
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\w2hfax" "UninstallString" '"$INSTDIR\uninstall.exe"' |
63 |
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\w2hfax" "NoModify" 1 |
64 |
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\w2hfax" "NoRepair" 1 |
65 |
|
|
WriteUninstaller "uninstall.exe" |
66 |
|
|
|
67 |
|
|
DetailPrint "Registering w2hfax COM-Server..." |
68 |
|
|
|
69 |
|
|
; register "w2hfax COM-Server" (a python class) using the PyWin library |
70 |
|
|
;nsExec::Exec "$INSTDIR\hfaxcom.py" |
71 |
|
|
; TODO: Use $pythonInstDir here! |
72 |
|
|
nsExec::Exec "python $INSTDIR\hfaxcom.py" |
73 |
|
|
|
74 |
|
|
SectionEnd |
75 |
|
|
|
76 |
|
|
|
77 |
|
|
Section "RedMon Port Redirection Monitor" |
78 |
|
|
|
79 |
|
|
SetDetailsPrint both |
80 |
|
|
DetailPrint "Installing RedMon Port Redirection Monitor..." |
81 |
|
|
|
82 |
|
|
;SectionIn RO |
83 |
|
|
|
84 |
|
|
StrCpy $redmonInstDir "$PROGRAMFILES\redmon17de" |
85 |
|
|
|
86 |
|
|
; Set output path to the installation directory. |
87 |
|
|
SetOutPath $redmonInstDir |
88 |
|
|
|
89 |
|
|
; Put file there |
90 |
|
|
File "C:\tmp\w2hfax-make\redmon17de\*.*" |
91 |
|
|
File "redmon_configure.reg" |
92 |
|
|
|
93 |
|
|
; Write the installation path into the registry |
94 |
|
|
WriteRegStr HKLM SOFTWARE\NSIS_redmon17de "Install_Dir" "$redmonInstDir" |
95 |
|
|
|
96 |
|
|
; Write the uninstall keys for Windows |
97 |
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\redmon17de" "DisplayName" "redmon17de" |
98 |
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\redmon17de" "UninstallString" '"$redmonInstDir\uninstall.exe"' |
99 |
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\redmon17de" "NoModify" 1 |
100 |
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\redmon17de" "NoRepair" 1 |
101 |
|
|
WriteUninstaller "uninstall.exe" |
102 |
|
|
|
103 |
|
|
DetailPrint "Registering RedMon Port Redirection Monitor..." |
104 |
|
|
nsExec::Exec "$redmonInstDir\setup.exe" |
105 |
|
|
|
106 |
|
|
DetailPrint "Configuring RedMon Port Redirection Monitor..." |
107 |
|
|
nsExec::Exec "$redmonInstDir\redmon_configure.reg" |
108 |
|
|
|
109 |
|
|
SectionEnd |
110 |
|
|
|
111 |
|
|
|
112 |
|
|
; Optional section (can be disabled by the user) |
113 |
|
|
Section "Start Menu Shortcuts" |
114 |
|
|
|
115 |
|
|
SetDetailsPrint both |
116 |
|
|
DetailPrint "Installing Start Menu and Desktop Shortcuts..." |
117 |
|
|
|
118 |
|
|
CreateDirectory "$SMPROGRAMS\w2hfax" |
119 |
|
|
CreateShortCut "$SMPROGRAMS\w2hfax\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
120 |
|
|
CreateShortCut "$SMPROGRAMS\w2hfax\w2hfax.lnk" "$INSTDIR\w2hfax.exe" "" "$INSTDIR\w2hfax.exe" 0 |
121 |
|
|
|
122 |
|
|
SectionEnd |
123 |
|
|
|
124 |
|
|
|
125 |
|
|
; -------------------------------- |
126 |
|
|
; Uninstaller |
127 |
|
|
; -------------------------------- |
128 |
|
|
|
129 |
|
|
Section "Uninstall" |
130 |
|
|
|
131 |
|
|
; ------------------ |
132 |
|
|
; uninstall redmon |
133 |
|
|
; ------------------ |
134 |
|
|
ReadRegStr $redmonInstDir HKLM "Software\NSIS_redmon17de" "Install_Dir" |
135 |
|
|
IfFileExists $redmonInstDir\unredmon.exe found |
136 |
|
|
Messagebox MB_OK "Uninstall path incorrect" |
137 |
|
|
Abort |
138 |
|
|
found: |
139 |
|
|
nsExec::Exec "$redmonInstDir\unredmon.exe" |
140 |
|
|
;Delete $redmonInstDir\uninstall.exe |
141 |
|
|
Delete "$redmonInstDir\*.*" |
142 |
|
|
RMDir "$redmonInstDir" |
143 |
|
|
|
144 |
|
|
|
145 |
|
|
; ------------------ |
146 |
|
|
; uninstall w2hfax |
147 |
|
|
; ------------------ |
148 |
|
|
|
149 |
|
|
; Remove registry keys |
150 |
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\w2hfax" |
151 |
|
|
DeleteRegKey HKLM SOFTWARE\NSIS_w2hfax |
152 |
|
|
|
153 |
|
|
; Remove registry keys |
154 |
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\redmon17de" |
155 |
|
|
DeleteRegKey HKLM SOFTWARE\NSIS_redmon17de |
156 |
|
|
|
157 |
|
|
|
158 |
|
|
; Remove files and uninstaller |
159 |
|
|
;Delete $INSTDIR\makensisw.exe |
160 |
|
|
;Delete $INSTDIR\uninstall.exe |
161 |
|
|
Delete "$INSTDIR\*.*" |
162 |
|
|
|
163 |
|
|
; Remove shortcuts, if any |
164 |
|
|
Delete "$SMPROGRAMS\w2hfax\*.*" |
165 |
|
|
|
166 |
|
|
; Remove directories used |
167 |
|
|
RMDir "$SMPROGRAMS\w2hfax" |
168 |
|
|
RMDir "$INSTDIR" |
169 |
|
|
|
170 |
|
|
SectionEnd |