-
Notifications
You must be signed in to change notification settings - Fork 1
/
sp.nsi
120 lines (84 loc) · 3.39 KB
/
sp.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
; Installer Source for NSIS 3.0 or higher
;Enable Unicode encoding
Unicode True
;Include Modern UI
!include "MUI2.nsh"
;General Settings
Name "$%PACKAGE_NAME_WITH_SYMBOL%"
Caption "$%PACKAGE_NAME_WITH_SYMBOL% v$%PACKAGE_VERSION%"
BrandingText "$%PACKAGE_NAME_WITH_SYMBOL% v$%PACKAGE_VERSION%"
VIAddVersionKey "ProductName" "$%PACKAGE_NAME_WITH_SYMBOL%"
VIAddVersionKey "ProductVersion" "$%PACKAGE_VERSION%"
VIAddVersionKey "FileDescription" "$%PACKAGE_NAME_WITH_SYMBOL% $%PACKAGE_VERSION% Installer"
VIAddVersionKey "FileVersion" "$%PACKAGE_VERSION%"
VIAddVersionKey "CompanyName" "$%COMPANY_NAME%"
VIAddVersionKey "LegalCopyright" "$%APP_URL%"
VIProductVersion "$%PACKAGE_VERSION_CLEAN%"
OutFile "$%OUTFILE%"
CRCCheck on
;SetCompressor /SOLID lzma
;Default installation folder
InstallDir "$LOCALAPPDATA\$%PACKAGE_NAME%"
;Request application privileges
RequestExecutionLevel user
;Define UI settings
!define MUI_ICON "$%MUI_ICON%"
!define MUI_UNICON "$%MUI_ICON%"
!define MUI_UI_HEADERIMAGE_RIGHT "$%MUI_UI_HEADERIMAGE_RIGHT%"
!define MUI_WELCOMEFINISHPAGE_BITMAP "$%MUI_WELCOMEFINISHPAGE_BITMAP%"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "$%MUI_WELCOMEFINISHPAGE_BITMAP%"
!define MUI_ABORTWARNING
!define MUI_FINISHPAGE_LINK "$%APP_URL%"
!define MUI_FINISHPAGE_LINK_LOCATION "$%APP_URL%"
!define MUI_FINISHPAGE_RUN "$INSTDIR\nw.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS ""
;Define the pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "$%MUI_PAGE_LICENSE%"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
;Define uninstall pages
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section ; Node Webkit Files
;Delete existing install
RMDir /r "$INSTDIR\App"
;Set output path to InstallDir
SetOutPath "$INSTDIR\App\node-webkit"
File /nonfatal /r /x pdf.dll /x package.json "$%ROOT_PATH%\node-webkit\*"
SectionEnd
Section ; App Files
;Set output path to InstallDir
SetOutPath "$INSTDIR\App\app"
File /r /x *.git "$%ROOT_PATH%\app\*"
File "/oname=app.ico" "$%MUI_ICON%"
SectionEnd
Section ; Others Files
SetOutPath "$INSTDIR"
File /r "$%ROOT_PATH%\overlay\*"
; use _config.json as default config if non present
IfFileExists $INSTDIR\config.json +2 0
Rename $INSTDIR\config.json.default $INSTDIR\config.json
;Create uninstaller
WriteUninstaller "$INSTDIR\App\Uninstall.exe"
SectionEnd
Section ; Shortcuts
CreateShortCut "$INSTDIR\$%PACKAGE_NAME%.lnk" "$INSTDIR\nw.exe" "" "$INSTDIR\App\app\app.ico" "" "" "" "$%PACKAGE_NAME%"
;Start Menu Shortcut
RMDir /r "$SMPROGRAMS\$%PACKAGE_NAME%"
CreateDirectory "$SMPROGRAMS\$%PACKAGE_NAME%"
CreateShortCut "$SMPROGRAMS\$%PACKAGE_NAME%\$%PACKAGE_NAME%.lnk" "$INSTDIR\nw.exe" "" "$INSTDIR\App\app\app.ico" "" "" "" "$%PACKAGE_NAME%"
CreateShortCut "$SMPROGRAMS\$%PACKAGE_NAME%\Uninstall $%PACKAGE_NAME%.lnk" "$INSTDIR\App\Uninstall.exe" "" "$INSTDIR\App\app\app.ico" "" "" "" "Uninstall $%PACKAGE_NAME%"
;Desktop Shortcut
Delete "$DESKTOP\$%PACKAGE_NAME%.lnk"
CreateShortCut "$DESKTOP\$%PACKAGE_NAME%.lnk" "$INSTDIR\nw.exe" "" "$INSTDIR\App\app\app.ico" "" "" "" "$%PACKAGE_NAME% $%PACKAGE_VERSION%"
SectionEnd
; Uninstaller
Section "uninstall"
RMDir /r "$INSTDIR"
RMDir /r "$SMPROGRAMS\$%PACKAGE_NAME%"
Delete "$DESKTOP\$%PACKAGE_NAME%.lnk"
NoUninstallData:
SectionEnd