-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenPOS.nsi
More file actions
256 lines (217 loc) · 12 KB
/
GenPOS.nsi
File metadata and controls
256 lines (217 loc) · 12 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# Initially Auto-generated by EclipseNSIS Script Wizard
# Jun 21, 2010 5:12:58 PM
# Modified by hand over the years after initial generation.
# See https://www.codeproject.com/Articles/24187/Creating-an-Installer for
# an introduction to NSIS installer scripts.
# --------------------------------------------------------------------------
# Georgia Southern University Research Services Foundation
# donated by NCR to the research foundation in 2002 and maintained here
# since. Created open source version using MIT license without proprietary
# information and created OpenGenPOS GitHub repository, https://github.com/opengenpos/genpos
# 2002 -> NHPOS Rel 1.4 (Windows CE for NCR 7448, Visual Studio Embedded)
# 2003 -> NHPOS Rel 2.0.0 (Windows XP for NCR touch screen, Datacap for EPT)
# 2006 -> NHPOS Rel 2.0.4 (Windows XP, Rel 2.0.4.51)
# 2006 -> NHPOS Rel 2.0.5 (Windows XP, US Customs, Store and Forward, Mobile Terminal, Rel 2.0.5.76)
# 2007 -> NHPOS Rel 2.1.0 (Windows XP, Condiment Edit and Tim Horton without Rel 2.0.5 changes, Rel 2.1.0.141)
# 2012 -> GenPOS Rel 2.2.0 (Windows 7, Amtrak and VCS, merge Rel 2.0.5 into Rel 2.1.0)
# 2014 -> GenPOS Rel 2.2.1 (Windows 7, Datacap Out of Scope, US Customs, Amtrak, VCS)
# 2016 -> GenPOS Rel 2.2.2 (Windows 7, maintenance releases using Visual Studio 2005 in parallel with Rel 2.3.0 using Visual Studio 2013)
# 2015 -> GenPOS Rel 2.3.0 (Windows 7, EMV card support, Out Of Scope control, compiler change to Visual Studio 2013 from Visual Studio 2005)
# 2019 -> GenPOS Rel 2.3.1 (Windows 10, compiler change to Visual Studio 2015 from Visual Studio 2013)
# 2020 -> GenPOS Rel 2.3.2 (Unreleased. Windows 10, 64 bit totals)
# 2021 -> GenPOS Rel 2.4.0 (Conversion to OpenGenPOS)
#
# moved from Visual Studio 6.0 to Visual Studio 2005 with Rel 2.2.0
# moved from Visual Studio 2015 to Visual Studio 2019 with Rel 2.4.0
# General Symbol Definitions
# NOTE: NSSIS installer has a number of predefined symbols that are used
# when updating/modifying the Windows Registry. See the following:
# - HKLM is HKEY_LOCAL_MACHINE
# - HKCU is HKEY_CURRENT_USER
# - HKCR is HKEY_CLASSES_ROOT
#
# NOTE: with 64 bit Windows OS, 32 bit entries get written to HKLM\Software\Wow6432Node rather than HKLM\Software
Name "OpenGenPOS Application"
!define REGKEY "SOFTWARE\$(^Name)"
!define REGKEY_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
!define REGKEY_SARATOGA_PIF_FILE "SOFTWARE\NCR\Saratoga\Pif\File"
!define REGKEY_SARATOGA_PIF_NETWORK "SOFTWARE\NCR\Saratoga\Pif\Network"
!define REGKEY_SARATOGA_PIF_OPTION "SOFTWARE\NCR\Saratoga\Pif\Option"
# NOTE: Change the build version number here as well as
# places where ALL_N_VERSIONINFO and ALL_M_VERSIONINFO
# are defined. See file versioninfo.h which contains these
# defines for GenPOS terminal application.
#
# See as well the copyright macro ALL_Q_COPYRIGHT.
#
# See as well macro for OutFile below containing installer file name.
!define VERSION 2.4.0.4
!define COMPANY OpenGenPOS
!define URL https://github.com/opengenpos
# MUI Symbol Definitions
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_LICENSEPAGE_RADIOBUTTONS
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
# Included files
!include Sections.nsh
!include MUI2.nsh
# Variables
Var StartMenuGroup
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "License"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE English
# Installer attributes
# OpenGenPOS uses the same directory structure as previous releases of GenPOS and NHPOS.
# NHPOS on the NCR 7448 use a non-standard directory tree.
OutFile GenPOS_rel_02_04_00_004.exe
InstallDir C:\FlashDisk\NCR\Saratoga
CRCCheck force
XPStyle on
ShowInstDetails show
VIProductVersion "${VERSION}"
VIAddVersionKey ProductName "$(^Name)"
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
VIAddVersionKey CompanyWebsite "${URL}"
VIAddVersionKey FileVersion "${VERSION}"
VIAddVersionKey FileDescription "OpenGenPOS Terminal Installer"
VIAddVersionKey LegalCopyright "Copyright (C) 2002-2024, Georgia Southern University"
InstallDirRegKey HKLM "${REGKEY}" Path
ShowUninstDetails show
RequestExecutionLevel admin
# Installer sections
Section -Main SEC0000
SetOverwrite on
SetOutPath $INSTDIR\Database
File NHPOS\defaultlayout
# File NHPOS\BUSINESSLOGIC\PARAMINI
# File NHPOS\BUSINESSLOGIC\PARAMTDR
SetOutPath $INSTDIR\Program
File NHPOS\bin\release\*.dll
File NHPOS\bin\release\*.exe
File NHPOS\bin\release\DeviceConfig.txt
SetOutPath $INSTDIR\Web
File NHPOS\WEB\index.html
File NHPOS\WEB\standard.css
File NHPOS\WEB\standard.js
File NHPOS\WEB\systemstatus.html
FILE NHPOS\WEB\storeforward.html
FILE NHPOS\WEB\preauth.html
SetOutPath $FONTS
File andalemo.ttf
SetOutPath $INSTDIR
# Beginning with Visual Studio 2017, it appears the directory structure has changed somewhat
# previous versions of Visual Studio such as Visual Studio 2015 and Visual Studio 2005.
# Visual Studio 2019 Community Edition
File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\v142\vcredist_x86.exe"
# Visual Studio 2015
# File "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\1033\vcredist_x86.exe"
# The location of the Visual Studio 2005 C++ Runtime Redistributable depends on the version of
# Windows being used to build the application. Beginning with Windows 7 there are now two different
# folder hierarchies for installed programs.
# Visual Studio 2005
# File "C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86\vcredist_x86.exe"
# File "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86\vcredist_x86.exe"
# setting the output path is critical, it affects the working directory of the following shortcuts
SetOutPath $INSTDIR\Program
# must create the directory before attempting to create shortcuts in it
CreateDirectory "$SMPROGRAMS\$StartMenuGroup"
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\OpenGenPOS Device Configuration Utility.lnk" $INSTDIR\Program\DeviceConfig.exe
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\OpenGenPOS Terminal Application.lnk" $INSTDIR\Program\Framework.exe
CreateShortcut "$DESKTOP\OpenGenPOS Device Configuration Utility.lnk" $INSTDIR\Program\DeviceConfig.exe
CreateShortcut "$DESKTOP\OpenGenPOS Terminal Application.lnk" $INSTDIR\Program\Framework.exe
# ExecWait '"$INSTDIR\vcredist_x86.exe"' #normal run (dialog with cancel button)
ExecWait '"$INSTDIR\vcredist_x86.exe" /q:a /c:"msiexec /i vcredist.msi /qb!"' #dialog with no cancel
# ExecWait '"$INSTDIR\vcredist_x86.exe" /q:a /c:"msiexec /i vcredist.msi /qn"' #totally silent
WriteRegStr HKLM "${REGKEY}\Components" Main 1
SectionEnd
Section -post SEC0001
Delete /REBOOTOK vcredist_x86.exe
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
SetOutPath $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
# Initialize Windows Registery data for OpenGenPOS startup. These Registery actions initialize
# Registry entries in the proper Registry tree, HKEY_LOCAL_MACHINE, so that the data is available
# to all Windows users that start up the OpenGenPOS application.
#
# NCR\Saratoga\Pif is retained for historical reasons. NCR originally developed the NeighborhoodPOS
# software then donated the intellectual property and materials to Georgia Southern University
# which continued to use the same Registery key as was used by NCR.
# Saratoga appears to have been the name of the project which combined the various
# NCR 2170 NHPOS software products into the single NCR 7448 NeighborhoodPOS software
# package. "Pif" stands for Platform Independent Functions, I think. This was an
# operating system abstraction layer that allowed NHPOS to be easily ported from the
# NCR 2170 OS, a version of some form of UNIX or MINIX it appears, and the NCR 7448 OS, Windows CE 2.12.
WriteRegStr HKLM "SOFTWARE\NCR\Saratoga\Pif\File" DataBase "Database"
WriteRegStr HKLM "SOFTWARE\NCR\Saratoga\Pif\File" Log "Log"
WriteRegStr HKLM "SOFTWARE\NCR\Saratoga\Pif\File" Path "C:\FlashDisk\NCR\Saratoga"
WriteRegStr HKLM "SOFTWARE\NCR\Saratoga\Pif\File" TempPath "C:\TempDisk\NCR\Saratoga"
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK "$DESKTOP\OpenGenPOS Device Configuration Utility.lnk"
Delete /REBOOTOK "$DESKTOP\OpenGenPOS Terminal Application.lnk"
# Delete /REBOOTOK $FONTS\andalemo.ttf
DeleteRegValue HKLM "${REGKEY}\Components" Main
SectionEnd
Section -un.post UNSEC0001
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
DeleteRegValue HKLM "${REGKEY}" Path
DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKLM "${REGKEY}"
# using /r forces the delete even if the directory isn't empty (which it won't be)
RmDir /r /REBOOTOK $SMPROGRAMS\$StartMenuGroup
# delete only the directories containing the program
RmDir /r /REBOOTOK $INSTDIR\Program
RmDir /r /REBOOTOK $INSTDIR\Web
# we leave the following directories to be deleted by hand
#RmDir /r /REBOOTOK $INSTDIR\Database
#RmDir /r /REBOOTOK $INSTDIR\Icons
SectionEnd
# Installer functions called by the NSSIS engine when doing an install
Function .onInit
InitPluginsDir
# Set the context of $SMPROGRAMS and other shell folders. See also un.onInit below.
SetShellVarContext all
StrCpy $StartMenuGroup "$(^Name)"
FunctionEnd
# Uninstaller functions called by the NSSIS engine when doing an uninstall
Function un.onInit
ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
# Set the context of $SMPROGRAMS and other shell folders. See also .onInit above.
SetShellVarContext all
StrCpy $StartMenuGroup "$(^Name)"
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd