forked from zlatinb/muwire-pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.nsi
80 lines (59 loc) · 1.87 KB
/
installer.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
# Uncomment on v3
# UniCode true
# uncomment when building production - takes forever
SetCompressor lzma
!include "version.nsi"
!define MUI_ICON MuWire.ico
!define MUI_FINISHPAGE
!include "MUI2.nsh"
Name "MuWire ${MUWIRE_VERSION}"
OutFile MuWire-${MUWIRE_VERSION}.exe
Icon MuWire.ico
RequestExecutionLevel admin
InstallDir "$PROGRAMFILES\MuWire"
PageEx license
licensetext "GPLv3"
licensedata "GPLv3-ud.txt"
PageExEnd
Page directory
Page instfiles
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Start MuWire now"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!insertmacro MUI_PAGE_FINISH
Function LaunchLink
ExecShell "" "$DESKTOP\MuWire.lnk"
FunctionEnd
Section Install
CreateDirectory $INSTDIR
SetOutPath $INSTDIR
File GPLv3-ud.txt
File MuWire.ico
File /r pkg\*.*
CreateDirectory "$INSTDIR\jre"
SetOutPath "$INSTDIR\jre"
File /r jre\*.*
SetShellVarContext current
CreateDirectory "$APPDATA\MuWire"
CreateDirectory "$APPDATA\MuWire\certificates"
SetOutPath "$APPDATA\MuWire\certificates"
File /r pkg\certificates\*.*
CreateDirectory "$APPDATA\MuWire\geoip"
SetOutPath "$APPDATA\MuWire\geoip"
File pkg\countries.txt
File pkg\continents.txt
File pkg\GeoLite2-Country.mmdb
CreateDirectory "$SMPROGRAMS\MuWire"
CreateShortCut "$SMPROGRAMS\MuWire\MuWire.lnk" "c:\Windows\system32\cmd.exe" "/c $\"$INSTDIR\muwire.bat$\"" "$INSTDIR\MuWire.ico"
CreateShortCut "$DESKTOP\MuWire.lnk" "c:\Windows\system32\cmd.exe" "/c $\"$INSTDIR\muwire.bat$\"" "$INSTDIR\MuWire.ico"
WriteUninstaller "$INSTDIR\uninstall-muwire.exe"
SectionEnd
Section "uninstall"
Delete "$INSTDIR\GPLv3-ud.txt"
Delete "$INSTDIR\MuWire.ico"
Delete "$INSTDIR\uninstall-muwire.exe"
Delete "$DESKTOP\MuWire.lnk"
RmDir /r "$SMPROGRAMS\MuWire"
RmDir /r "$INSTDIR\jre"
RmDir /r "$INSTDIR"
SectionEnd