-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsetup.nsi
122 lines (74 loc) · 2.62 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
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
; example1.nsi
;
; This script is perhaps one of the simplest NSIs you can make. All of the
; optional settings are left to their default settings. The installer simply
; prompts the user asking them where to install, and drops a copy of example1.nsi
; there.
;--------------------------------
!include "MUI2.nsh"
!include "x64.nsh" ; Macros for x64 machines
; The name of the installer
Name "CanMonitor"
; The file to write
OutFile "canmonitor-Setup.exe"
; Show install details
ShowInstDetails show
; The default installation directory
InstallDir "$PROGRAMFILES\CanMonitor\"
; Request application privileges for Windows Vista
;RequestExecutionLevel Admin
SetOverwrite on
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ; optional
!define MUI_ABORTWARNING
;--------------------------------
; Pages
!insertmacro MUI_PAGE_LICENSE "License-GPLv3.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;Page instfiles
; The stuff to install
Section "CanMonitor" Secopeneds ;No components page, name is not important
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File canmonitor\bin\Release\*.exe
File canmonitor\bin\Release\*.dll
File canmonitor\GroupBy_284.ico
File canmonitor\bin\Release\autoload.txt
Delete "$INSTDIR\Plugins\*"
SetOutPath $INSTDIR\Plugins
File canmonitor\bin\Release\plugins\*.dll
SetOutPath $INSTDIR\Drivers
File canmonitor\bin\Release\drivers\*.dll
SetOutPath $INSTDIR
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\CanMonitor"
CreateShortCut "$SMPROGRAMS\CanMonitor\CanMonitor.lnk" $INSTDIR\CanMonitor.exe "" $INSTDIR\GroupBy_284.ico 0
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateShortCut "$SMPROGRAMS\CanMonitor\Uninstall.lnk" $INSTDIR\Uninstall.exe
SectionEnd ; end the section
;Language strings
LangString DESC_Secopeneds ${LANG_ENGLISH} "CanMonitor"
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Secopeneds} $(DESC_Secopeneds)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function .onInit
;Extract InstallOptions files
;$PLUGINSDIR will automatically be removed when the installer closes
InitPluginsDir
Push $0
Pop $0
FunctionEnd
Section "Uninstall"
;ADD YOUR OWN FILES HERE...
Delete "$INSTDIR\*"
Delete "$INSTDIR\Plugins\*"
SetShellVarContext all
Delete "$SMPROGRAMS\CanMonitor\CanMonitor.lnk"
RMDir "$SMPROGRAMS\CanMonitor"
SectionEnd