-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_script.nsi
More file actions
77 lines (57 loc) · 2.3 KB
/
install_script.nsi
File metadata and controls
77 lines (57 loc) · 2.3 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
# Install Script for NetCDF4Excel_2007
# define installer name
outFile "NetCDF4Excel_2_2_setup.exe"
# set ProgramFiles as default install directory
installDir $PROGRAMFILES\NetCDF4Excel
# let user choose another directory
DirText "Choose a directory"
!include "EnvVarUpdate.nsh"
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
;--------------------------------
Name "NetCDF4Excel"
;--------------------------------
;Version Information
VIProductVersion "2.2.0.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "NetCDF4Excel"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright 2008 - 2014 Alexander Bruhns"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Excel 2007 Add-In for NetcDF"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "2.2"
;--------------------------------
Page license
LicenseData "license.txt"
LicenseForceSelection checkbox
LicenseForceSelection checkbox "I accept"
;--------------------------------
Page instfiles
# default section start
section
# define output path
setOutPath $INSTDIR
# specify file to go in output path
file VbNc\Release\VbNc.dll
file NetCDF4Excel_2007.xlsm
# define uninstaller name
writeUninstaller $INSTDIR\uninstaller.exe
# create shortcuts
CreateDirectory "$SMPROGRAMS\NetCDF4Excel"
createShortCut "$SMPROGRAMS\NetCDF4Excel\Uninstall.lnk" "$INSTDIR\uninstaller.exe"
createShortCut "$SMPROGRAMS\NetCDF4Excel\NetCDF4Excel_2007.xlsm.lnk" "$INSTDIR\NetCDF4Excel_2007.xlsm"
createShortCut "$DESKTOP\NetCDF4Excel_2007.xlsm.lnk" "$INSTDIR\NetCDF4Excel_2007.xlsm"
# setting environment
${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"
sectionEnd
# create a section to define what the uninstaller does.
# the section will always be named "Uninstall"
section "Uninstall"
# Always delete uninstaller first
delete $INSTDIR\uninstaller.exe
# now delete installed file
delete $INSTDIR\VbNc.dll
delete $INSTDIR\NetCDF4Excel_2007.xlsm
RMDIR $INSTDIR
delete "$SMPROGRAMS\NetCDF4Excel\Uninstall.lnk"
delete "$SMPROGRAMS\NetCDF4Excel\NetCDF4Excel_2007.xlsm.lnk"
RMDIR "$SMPROGRAMS\NetCDF4Excel"
delete "$DESKTOP\NetCDF4Excel_2007.xlsm.lnk"
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"
sectionEnd