forked from open-rpa/openrpa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openrpa.nsi
281 lines (254 loc) · 12.7 KB
/
openrpa.nsi
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
!include "Sections.nsh"
!include "LogicLib.nsh"
!include "x64.nsh"
; !include "StrFunc.nsh"
!include "StrRep.nsh"
!include "ReplaceInFile.nsh"
Name "OpenRPA"
OutFile "OpenRPA.exe"
InstallDir $PROGRAMFILES\OpenRPA
function .onInit
${If} ${RunningX64}
SetRegView 64
StrCpy $INSTDIR "$PROGRAMFILES64\OpenRPA"
${EndIf}
functionEnd
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\OpenRPA" "Install_Dir"
; Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
; Pages
Var hasoffice
;var version
Page Custom CheckForOffice
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
Function CheckForOffice
; https://stackoverflow.com/questions/27839860/nsis-check-if-registry-key-value-exists
ClearErrors
SetRegView 32
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Office\16.0\Excel\InstallRoot" "Path"
; MessageBox MB_OKCANCEL $0
${If} ${Errors}
StrCpy $hasoffice "false"
ClearErrors
${Else}
StrCpy $hasoffice "true"
${EndIf}
${If} $hasoffice == "false"
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Office\15.0\Excel\InstallRoot" "Path"
${If} ${Errors}
StrCpy $hasoffice "false"
${Else}
StrCpy $hasoffice "true"
${EndIf}
${EndIf}
${If} $hasoffice == "false"
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Office\14.0\Excel\InstallRoot" "Path"
${If} ${Errors}
StrCpy $hasoffice "false"
${Else}
StrCpy $hasoffice "true"
${EndIf}
${EndIf}
${If} ${RunningX64}
SetRegView 64
${If} $hasoffice == "false"
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Office\16.0\Excel\InstallRoot" "Path"
; MessageBox MB_OKCANCEL $0
${If} ${Errors}
StrCpy $hasoffice "false"
ClearErrors
${Else}
StrCpy $hasoffice "true"
${EndIf}
${EndIf}
${If} $hasoffice == "false"
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Office\15.0\Excel\InstallRoot" "Path"
${If} ${Errors}
StrCpy $hasoffice "false"
${Else}
StrCpy $hasoffice "true"
${EndIf}
${EndIf}
${If} $hasoffice == "false"
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Office\14.0\Excel\InstallRoot" "Path"
${If} ${Errors}
StrCpy $hasoffice "false"
${Else}
StrCpy $hasoffice "true"
${EndIf}
${EndIf}
; https://nsis.sourceforge.io/Managing_Sections_on_Runtime
${If} $hasoffice == "false"
SectionSetFlags 2 0 ; unselect office, when not found
${EndIf}
SetRegView LastUsed
${EndIf}
SectionSetFlags 11 0 ; unselect Java per default
SectionSetFlags 12 0 ; unselect High Density robots per default
SectionSetFlags 13 0 ; unselect Elis Rossum per default
SectionSetFlags 14 0 ; unselect Process Discovery per default
FunctionEnd
Section "Base robot files" ; section 0
SectionIn RO
SetOutPath $INSTDIR\Updater
File /r "C:\code\openrpa\OpenRPA.Updater\bin\PrepInstaller\net462\*"
SetOutPath $INSTDIR\Packages
File "C:\code\openrpa\packages\*.nupkg"
SetOutPath $INSTDIR
File /r "C:\code\openrpa\OpenRPA\bin\PrepInstaller\net462\*"
File /r "C:\code\openrpa\OpenRPA.Utilities\bin\PrepInstaller\net462\*"
WriteRegStr HKLM SOFTWARE\OpenRPA "Install_Dir" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRPA" "DisplayName" "OpenRPA"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRPA" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRPA" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRPA" "NoRepair" 1
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
Section "Start Menu Shortcuts" ; section 1
CreateDirectory "$SMPROGRAMS\OpenRPA"
CreateShortcut "$SMPROGRAMS\OpenRPA\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortcut "$SMPROGRAMS\OpenRPA\OpenRPA.lnk" "$INSTDIR\OpenRPA.exe" "" "$INSTDIR\OpenRPA.exe" 0
SectionEnd
Section "Uninstall"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRPA"
DeleteRegKey HKLM SOFTWARE\OpenRPA
Delete "$SMPROGRAMS\OpenRPA\*.*"
RMDir "$SMPROGRAMS\OpenRPA"
RMDir /r /REBOOTOK "$INSTDIR"
SectionEnd
Section "Office" ; section 2
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.Office\bin\PrepInstaller\net462\Microsoft.Office.Interop.Excel.dll"
File "C:\code\openrpa\OpenRPA.Office\bin\PrepInstaller\net462\Microsoft.Office.Interop.Outlook.dll"
File "C:\code\openrpa\OpenRPA.Office\bin\PrepInstaller\net462\Microsoft.Office.Interop.PowerPoint.dll"
File "C:\code\openrpa\OpenRPA.Office\bin\PrepInstaller\net462\Microsoft.Office.Interop.Word.dll"
File "C:\code\openrpa\OpenRPA.Office\bin\PrepInstaller\net462\OpenRPA.Office.dll"
File "C:\code\openrpa\OpenRPA.Office\bin\PrepInstaller\net462\OpenRPA.Office.pdb"
File /r "C:\code\openrpa\OpenRPA.Office\bin\PrepInstaller\net462\OpenRPA.Office.resources.dll"
SectionEnd
Section "Forms" ; section 3
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\ControlzEx.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\FastMember.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\Forge.Forms.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\Humanizer.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\MahApps.Metro.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\MaterialDesignColors.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\MaterialDesignThemes.Wpf.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\Microsoft.Win32.Primitives.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\OpenRPA.Forms.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\OpenRPA.Forms.pdb"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\ToastNotifications.dll"
File "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\ToastNotifications.Messages.dll"
File /r "C:\code\openrpa\OpenRPA.Forms\bin\PrepInstaller\net462\OpenRPA.Forms.resources.dll"
SectionEnd
Section "IE" ; section 4
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.IE\bin\PrepInstaller\net462\OpenRPA.IE.dll"
File "C:\code\openrpa\OpenRPA.IE\bin\PrepInstaller\net462\OpenRPA.IE.pdb"
File /r "C:\code\openrpa\OpenRPA.IE\bin\PrepInstaller\net462\OpenRPA.IE.resources.dll"
SectionEnd
Section "Chrome and Firefox (NM)" ; section 5
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.NM\bin\PrepInstaller\net462\OpenRPA.NativeMessagingHost.exe"
File "C:\code\openrpa\OpenRPA.NM\bin\PrepInstaller\net462\OpenRPA.NativeMessagingHost.exe.config"
File "C:\code\openrpa\OpenRPA.NM\bin\PrepInstaller\net462\OpenRPA.NativeMessagingHost.pdb"
File "C:\code\openrpa\OpenRPA.NM\bin\PrepInstaller\net462\OpenRPA.NM.dll"
File "C:\code\openrpa\OpenRPA.NM\bin\PrepInstaller\net462\OpenRPA.NM.pdb"
File /r "C:\code\openrpa\OpenRPA.NM\bin\PrepInstaller\net462\OpenRPA.NM.resources.dll"
# SetOverwrite ifnewer
File "C:\code\openrpa\OpenRPA.NM\bin\PrepInstaller\net462\chromemanifest.json"
File "C:\code\openrpa\OpenRPA.NM\bin\PrepInstaller\net462\ffmanifest.json"
!insertmacro StrRep '$0' "$INSTDIR\OpenRPA.NativeMessagingHost.exe" '\' '\\'
!insertmacro _ReplaceInFile "chromemanifest.json" "REPLACEPATH" $0
!insertmacro _ReplaceInFile "ffmanifest.json" "REPLACEPATH" $0
SectionEnd
Section "Image recognition and OCR" ; section 6
SetOutPath $INSTDIR\x64
File /r "C:\code\openrpa\OpenRPA.Image\bin\PrepInstaller\net462\x64\*.*"
SetOutPath $INSTDIR\x86
File /r "C:\code\openrpa\OpenRPA.Image\bin\PrepInstaller\net462\x86\*.*"
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.Image\bin\PrepInstaller\net462\Emgu.CV.UI.dll"
File "C:\code\openrpa\OpenRPA.Image\bin\PrepInstaller\net462\Emgu.CV.World.dll"
File "C:\code\openrpa\OpenRPA.Image\bin\PrepInstaller\net462\OpenRPA.Image.dll"
File "C:\code\openrpa\OpenRPA.Image\bin\PrepInstaller\net462\OpenRPA.Image.pdb"
File "C:\code\openrpa\OpenRPA.Image\bin\PrepInstaller\net462\ZedGraph.dll"
File /r "C:\code\openrpa\OpenRPA.Image\bin\PrepInstaller\net462\OpenRPA.Image.resources.dll"
SectionEnd
Section "Generic Scripting support" ; section 7
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.Script\bin\PrepInstaller\net462\OpenRPA.Script.dll"
File "C:\code\openrpa\OpenRPA.Script\bin\PrepInstaller\net462\OpenRPA.Script.pdb"
File "C:\code\openrpa\OpenRPA.Script\bin\PrepInstaller\net462\Python.Included.dll"
File "C:\code\openrpa\OpenRPA.Script\bin\PrepInstaller\net462\Python.Runtime.NETStandard.dll"
File "C:\code\openrpa\OpenRPA.Script\bin\PrepInstaller\net462\sharpAHK.dll"
File /r "C:\code\openrpa\OpenRPA.Script\bin\PrepInstaller\net462\OpenRPA.Script.resources.dll"
SectionEnd
Section "AviRecorder" ; section 8
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.AviRecorder\bin\PrepInstaller\net462\NAudio.dll"
File "C:\code\openrpa\OpenRPA.AviRecorder\bin\PrepInstaller\net462\OpenRPA.AviRecorder.dll"
File "C:\code\openrpa\OpenRPA.AviRecorder\bin\PrepInstaller\net462\OpenRPA.AviRecorder.pdb"
File "C:\code\openrpa\OpenRPA.AviRecorder\bin\PrepInstaller\net462\SharpAvi.dll"
File /r "C:\code\openrpa\OpenRPA.AviRecorder\bin\PrepInstaller\net462\OpenRPA.AviRecorder.resources.dll"
SectionEnd
Section "OpenFlowDB" ; section 9
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.OpenFlowDB\bin\PrepInstaller\net462\OpenRPA.OpenFlowDB.dll"
File "C:\code\openrpa\OpenRPA.OpenFlowDB\bin\PrepInstaller\net462\OpenRPA.OpenFlowDB.pdb"
File /r "C:\code\openrpa\OpenRPA.OpenFlowDB\bin\PrepInstaller\net462\OpenRPA.OpenFlowDB.resources.dll"
SectionEnd
Section "FileWatcher" ; section 10
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.FileWatcher\bin\PrepInstaller\net462\OpenRPA.FileWatcher.dll"
File "C:\code\openrpa\OpenRPA.FileWatcher\bin\PrepInstaller\net462\OpenRPA.FileWatcher.pdb"
File /r "C:\code\openrpa\OpenRPA.FileWatcher\bin\PrepInstaller\net462\OpenRPA.FileWatcher.resources.dll"
SectionEnd
Section "Java support" ; section 11
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\OpenRPA.Java.dll"
File "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\OpenRPA.Java.dll.config"
File "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\OpenRPA.Java.pdb"
File "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\OpenRPA.JavaBridge.exe"
File "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\OpenRPA.JavaBridge.exe.config"
File "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\OpenRPA.JavaBridge.pdb"
File "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\WindowsAccessBridgeInterop.dll"
File "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\WindowsAccessBridgeInterop.pdb"
File /r "C:\code\openrpa\OpenRPA.Java\bin\PrepInstaller\net462\OpenRPA.Java.resources.dll"
SectionEnd
Section "High Density robots using Remote Desktop" ; section 12
SetOutPath $INSTDIR\x64
File /r "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\x64\*.*"
SetOutPath $INSTDIR\x86
File /r "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\x86\*.*"
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\AxInterop.MSTSCLib.dll"
File "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\FreeRDP.dll"
File "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\MSTSCLib.dll"
File "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\OpenRPA.RDService.exe"
File "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\OpenRPA.RDService.exe.config"
File "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\OpenRPA.RDService.pdb"
File "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\OpenRPA.RDServicePlugin.dll"
File "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\OpenRPA.RDServicePlugin.pdb"
; File /r "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\OpenRPA.RDService.resources.dll"
File /r "C:\code\openrpa\OpenRPA.RDServicePlugin\bin\PrepInstaller\net462\OpenRPA.RDServicePlugin.resources.dll"
SectionEnd
Section "Elis Rossum" ; section 13
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.Elis.Rossum\bin\PrepInstaller\net462\OpenRPA.Elis.Rossum.dll"
File "C:\code\openrpa\OpenRPA.Elis.Rossum\bin\PrepInstaller\net462\OpenRPA.Elis.Rossum.pdb"
File /r "C:\code\openrpa\OpenRPA.Elis.Rossum\bin\PrepInstaller\net462\OpenRPA.Elis.Rossum.resources.dll"
SectionEnd
Section "Process Discovery" ; section 14
SetOutPath $INSTDIR
File "C:\code\openrpa\OpenRPA.PDPlugin\bin\PrepInstaller\net462\OpenRPA.PDPlugin.dll"
File "C:\code\openrpa\OpenRPA.PDPlugin\bin\PrepInstaller\net462\OpenRPA.PDPlugin.pdb"
SectionEnd