hllapi.nsi.in
3.05 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
!include "MUI2.nsh"
!include "x64.nsh"
!include "FileFunc.nsh"
Name "@PACKAGE@"
Caption "@PACKAGE@ - @PACKAGE_DESCRIPTION@"
outfile "@PACKAGE@-@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@-@host_cpu@.exe"
XPStyle on
installDir "$@PROGRAMFILES@\@PACKAGE@"
# Get installation folder from registry if available
InstallDirRegKey HKLM "Software\@PACKAGE@" "InstallLocation"
RequestExecutionLevel admin
# Properties
VIProductVersion "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@"
VIFileVersion "@WIN32_VERSION@"
VIAddVersionKey "ProductVersion" "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.@PACKAGE_MINOR_RELEASE@"
VIAddVersionKey "FileVersion" "@WIN32_VERSION@"
VIAddVersionKey "ProductName" "@PACKAGE_NAME@"
VIAddVersionKey "FileDescription" "@PACKAGE_DESCRIPTION@"
VIAddVersionKey "LegalCopyright" "GPL-2.0"
# Interface
!define MUI_ABORTWARNING
# !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
# !insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# !insertmacro MUI_UNPAGE_FINISH
# Languages
!insertmacro MUI_LANGUAGE "English"
# Section scripts
!include Sections.nsh
# default section
SubSection "@PACKAGE@" SecMain
Section "Core" SecCore
# define the output path for this file
setOutPath $SYSDIR
SetShellVarContext all
SetRegView @WINARCH@
${@NSISREDIR@}
file "/oname=$SYSDIR\hllapi.dll" "libhllapi.dll"
# For compatibility with old scripts.
file "/oname=$SYSDIR\libhllapi.dll" "libhllapi.dll"
# define uninstaller name
SetRegView 32
writeUninstaller $INSTDIR\uninstall.exe
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"DisplayName" "@PACKAGE@ - @PACKAGE_DESCRIPTION@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"DisplayVersion" "@PACKAGE_VERSION@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"InstallLocation" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"NoModify" "1"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"NoRepair" "1"
# Save instalation dir
WriteRegStr HKCU "Software\@PACKAGE@" "" $INSTDIR
sectionEnd
SubSectionEnd
Section "Uninstall"
# Always delete uninstaller first
delete $INSTDIR\uninstaller.exe
# delete installed files
${@NSISREDIR@}
delete $SYSDIR\hllapi.dll
delete $SYSDIR\libhllapi.dll
# Remove registry
SetRegView 32
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@"
DeleteRegKey HKLM "Software\@PACKAGE@"
SetRegView @WINARCH@
DeleteRegKey HKLM "Software\@PACKAGE@"
SectionEnd