-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvSetup.nsi
More file actions
98 lines (76 loc) · 2.44 KB
/
vSetup.nsi
File metadata and controls
98 lines (76 loc) · 2.44 KB
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
; :Author: snxx
; :Copyright: GPL v3.0
;---------------------
!addincludedir "${objdir}\V"
!addincludedir "${srcdir}\V"
!include "version.nsh"
!include "arch.nsh"
!define PRODUCT_NAME "Vlang"
!define PRODUCT_SHORT_NAME "V"
!define PACKAGE_NAME "${PRODUCT_NAME} ${VERSION}"
!define PACKAGE_SHORT_NAME "${PRODUCT_SHORT_NAME}-${VERSION}"
!if "${VLANG_PACKEDVERSION}" >= 0x3000000
Unicode True
!endif
!define MULTIUSER_EXECUTIONLEVEL Highest
!define MULTIUSER_MUI
!define MULTIUSER_INSTALLMODE_COMMANDLINE
!define MULTIUSER_INSTALLMODE_INSTDIR "V"
!include "VMultiUser.nsh"
!insertmacro MULTIUSER_PAGE_INSTALLMODE
!insertmacro MULTIUSER_INSTALLMODEPAGE_INTERFACE
; The name of the installer
Name "${PACKAGE_NAME} Setup"
OutFile "vSetup.exe"
; Check Example: https://github.com/v-libs/vSetup/blob/master/vlang.reg
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\"
;--------------------------------
; Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------
; Variables
Var StartMenuFolder
Var CmdFailed
;------------
; Interface Settings
Caption "${PACKAGE_SHORT_NAME}"
Icon "${srcdir}\nsis\setup.ico"
UninstallIcon "${srcdir}\nsis\unins000.ico"
;-------------------------------------------------
; The default installation directory
; Path: %LocalAppData%\Programs\V\v.30-32-bit\v.exe
InstallDir "$APPDATA\Local\Programs\V"
;-------------------------------------
; Pages
!insertmacro MUI_PAGE_DIRECTORY
Page directory
Page instfiles
UninstPage uninstConfirm
;-----------------------
!insertmacro MUI_LANGUAGE English
; The staff to install
Section "VLANG" SecVlang
Sectionin
SetOutPath "$APPDATA\Local\Programs\V\v.30-32-bit"
File ""
WriteRegStr HKLM ""
WriteUninstaller "$\unins000.exe"
SectionEnd ; end the Staff section
;---------------------------------
Section "Manual" SecManual
SetOutPath "$INSTDIR"
File "${objdir}\docs\doc.chm"
CreateShortCut "${}\$StartMenuFolder\man.lnk" "$INSTDIR\v${VLANG_PACKEDVERSION}.chm"
SectionEnd ; end the Manual section
;----------------------------------
; Uninstaller
Section "Uninstall"
DeleteRegKey HKLM ""
Delete "$APPDATA\Local\Programs\V\v.30-32-bit\v.exe"
Delete "$APPDATA\Local\Programs\V\v.30-32-bit\unins000.exe"
RMDir "$APPDATA\Local\Programs\V\v.30-32-bit"
RMDir "$APPDATA\Local\Programs\V"
SectionEnd ; end the Uninstall section
;-------------------------------------