-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.nsi
50 lines (43 loc) · 1.23 KB
/
setup.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
!define py2exeOutputDir 'dist'
!define exe 'Artisan.exe'
!define icon 'artisan.ico'
!define compressor 'zlib' ;one of 'zlib', 'bzip2', 'lzma'
!define onlyOneInstance
!include FileFunc.nsh
!insertmacro GetParameters
; - - - - do not edit below this line, normaly - - - -
!ifdef compressor
SetCompressor ${compressor}
!else
SetCompress Off
!endif
Name ${exe}
OutFile ${exe}
SilentInstall silent
!ifdef icon
Icon ${icon}
!endif
; - - - - Allow only one installer instance - - - -
!ifdef onlyOneInstance
Function .onInit
System::Call "kernel32::CreateMutexA(i 0, i 0, t '$(^Name)') i .r0 ?e"
Pop $0
StrCmp $0 0 launch
Abort
launch:
FunctionEnd
!endif
; - - - - Allow only one installer instance - - - -
Section
; Get directory from which the exe was called
System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)"
; Unzip into pluginsdir
InitPluginsDir
SetOutPath '$PLUGINSDIR'
File /r '${py2exeOutputDir}\*.*'
; Set working dir and execute, passing through commandline params
SetOutPath '$0'
${GetParameters} $R0
ExecWait '"$PLUGINSDIR\${exe}" $R0' $R2
SetErrorLevel $R2
SectionEnd