1
+ # Copyright 2021 Ingemar Hedvall
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ !include MUI2.nsh
5
+ !include x64.nsh
6
+ !include FileFunc.nsh
7
+
8
+ Name " Report Server Applications and Libraries"
9
+ OutFile " ..\cmake-build-release\report_server.exe"
10
+ Unicode True
11
+
12
+ RequestExecutionLevel admin
13
+
14
+ Var StartMenuFolder
15
+
16
+ InstallDir " $LOCALAPPDATA\ReportServer"
17
+ InstallDirRegKey HKLM " Software\ReportServer" " "
18
+
19
+
20
+ !define MUI_ABORTWARNING
21
+ !define ARP " Software\Microsoft\Windows\CurrentVersion\Uninstall\ReportServer"
22
+
23
+ !insertmacro MUI_PAGE_WELCOME
24
+ !insertmacro MUI_PAGE_LICENSE " ..\LICENSE"
25
+ !insertmacro MUI_PAGE_COMPONENTS
26
+ !insertmacro MUI_PAGE_DIRECTORY
27
+
28
+ !define MUI_STARTMENUPAGE_DEFAULTFOLDER " Report Server"
29
+ !define MUI_STARTMENUPAGE_REGISTRY_ROOT " HKLM"
30
+ !define MUI_STARTMENUPAGE_REGISTRY_KEY " Software\ReportServer"
31
+ !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME " Start Menu Folder"
32
+ !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
33
+
34
+ !insertmacro MUI_PAGE_INSTFILES
35
+ !insertmacro MUI_PAGE_FINISH
36
+
37
+ !insertmacro MUI_UNPAGE_WELCOME
38
+ !insertmacro MUI_UNPAGE_CONFIRM
39
+ !insertmacro MUI_UNPAGE_INSTFILES
40
+ !insertmacro MUI_UNPAGE_FINISH
41
+
42
+ !insertmacro MUI_LANGUAGE " English"
43
+
44
+ ; --------------------------------
45
+ ; Installer Sections
46
+
47
+ Section " Applications" App
48
+ SectionIn RO
49
+ SetRegView 64
50
+ SetShellVarContext all
51
+
52
+ SetOutPath " $INSTDIR\bin"
53
+ File " ..\cmake-build-release\mdfviewer\*.exe"
54
+
55
+ SetOutPath " $INSTDIR\img"
56
+ File " ..\img\*.*"
57
+
58
+ ; Store installation folder
59
+ WriteRegStr HKLM " Software\ReportServer" " " $INSTDIR
60
+
61
+ WriteUninstaller " $INSTDIR\Uninstall.exe"
62
+
63
+ ; Add /Remove Programs
64
+ ${GetSize} " $INSTDIR" " /S=0K" $0 $1 $2
65
+ IntFmt $0 " 0x%08X" $0
66
+
67
+
68
+ WriteRegNone HKLM " ${ARP}" " "
69
+ WriteRegStr HKLM " ${ARP}" " InstallLocation" $INSTDIR
70
+ WriteRegStr HKLM " ${ARP}" " DisplayIcon" " $INSTDIR\img\server.ico"
71
+ WriteRegStr HKLM " ${ARP}" " DisplayName" " Report Server 1.0"
72
+ WriteRegStr HKLM " ${ARP}" " DisplayVersion" " 1.0.0"
73
+ WriteRegStr HKLM " ${ARP}" " Publisher" " Ingemar Hedvall"
74
+ WriteRegDWORD HKLM " ${ARP}" " NoModify" 1
75
+ WriteRegDWORD HKLM " ${ARP}" " NoRepair" 1
76
+ WriteRegDWORD HKLM " ${ARP}" " VersionMajor" 1
77
+ WriteRegDWORD HKLM " ${ARP}" " VersionMinor" 0
78
+ WriteRegDWORD HKLM " ${ARP}" " EstimatedSize" " $0"
79
+ WriteRegStr HKLM " ${ARP}" " UninstallString" " $\" $INSTDIR\Uninstall.exe$\" "
80
+
81
+ ; Create uninstaller
82
+
83
+
84
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
85
+ CreateDirectory " $SMPROGRAMS\$StartMenuFolder"
86
+ CreateShortcut " $SMPROGRAMS\$StartMenuFolder\MDF Viewer.lnk" " $INSTDIR\bin\mdfview.exe"
87
+ !insertmacro MUI_STARTMENU_WRITE_END
88
+
89
+ SectionEnd
90
+
91
+ Section /o " Util Library" Util
92
+ SetRegView 64
93
+
94
+ SetOutPath " $INSTDIR\lib"
95
+ File " ..\cmake-build-release\utillib\libutil.a"
96
+ File " ..\cmake-build-debug\utillib\libutild.a"
97
+
98
+ SetOutPath " $INSTDIR\include\util"
99
+ File " ..\utillib\include\util\*.*"
100
+
101
+ SetOutPath " $INSTDIR\doc\util"
102
+ File /r " ..\cmake-build-release\utillib\html\*.*"
103
+
104
+ CreateShortcut " $SMPROGRAMS\$StartMenuFolder\Util Library Documentation.lnk" \
105
+ " $INSTDIR\doc\util\index.html" " " " $INSTDIR\img\document.ico" \
106
+ 0 SW_SHOWNORMAL
107
+
108
+ ${GetSize} " $INSTDIR" " /S=0K" $0 $1 $2
109
+ IntFmt $0 " 0x%08X" $0
110
+ WriteRegDWORD HKLM " ${ARP}" " EstimatedSize" " $0"
111
+ SectionEnd
112
+
113
+ Section /o " MDF Library" MDF
114
+ SetRegView 64
115
+
116
+ SetOutPath " $INSTDIR\lib"
117
+ File " ..\cmake-build-release\mdflib\libmdf.a"
118
+ File " ..\cmake-build-debug\mdflib\libmdfd.a"
119
+
120
+ SetOutPath " $INSTDIR\include\mdf"
121
+ File " ..\mdflib\include\mdf\*.*"
122
+
123
+ SetOutPath " $INSTDIR\doc\mdf"
124
+ File /r " ..\cmake-build-release\mdflib\html\*.*"
125
+
126
+ CreateShortcut " $SMPROGRAMS\$StartMenuFolder\MDF Library Documentation.lnk" \
127
+ " $INSTDIR\doc\mdf\index.html" " " " $INSTDIR\img\document.ico" \
128
+ 0 SW_SHOWNORMAL
129
+
130
+ ${GetSize} " $INSTDIR" " /S=0K" $0 $1 $2
131
+ IntFmt $0 " 0x%08X" $0
132
+ WriteRegDWORD HKLM " ${ARP}" " EstimatedSize" " $0"
133
+ SectionEnd
134
+
135
+
136
+ LangString DESC_App ${LANG_ENGLISH} " All executables."
137
+ LangString DESC_Util ${LANG_ENGLISH} " Util Library"
138
+ LangString DESC_MDF ${LANG_ENGLISH} " MDF Library"
139
+
140
+
141
+ !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
142
+ !insertmacro MUI_DESCRIPTION_TEXT ${App} $(DESC_App)
143
+ !insertmacro MUI_DESCRIPTION_TEXT ${Util} $(DESC_Util)
144
+ !insertmacro MUI_DESCRIPTION_TEXT ${MDF} $(DESC_MDF)
145
+ !insertmacro MUI_FUNCTION_DESCRIPTION_END
146
+
147
+ ; --------------------------------
148
+ ; Uninstaller Section
149
+
150
+ Section " Uninstall"
151
+ SetRegView 64
152
+ SetShellVarContext all
153
+ !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
154
+
155
+ Delete " $INSTDIR\Uninstall.exe"
156
+
157
+ RMDir /r " $INSTDIR"
158
+ RMDir /r " $SMPROGRAMS\$StartMenuFolder"
159
+
160
+ DeleteRegKey HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\ReportServer"
161
+ DeleteRegKey HKLM " Software\ReportServer"
162
+
163
+ SectionEnd
0 commit comments