1
|
; Script generated by the HM NIS Edit Script Wizard.
|
2
|
|
3
|
;Copy a file
|
4
|
!define FileCopy `!insertmacro FileCopy`
|
5
|
!macro FileCopy FilePath TargetDir
|
6
|
CreateDirectory `${TargetDir}`
|
7
|
CopyFiles `${FilePath}` `${TargetDir}`
|
8
|
!macroend
|
9
|
|
10
|
; HM NIS Edit Wizard helper defines
|
11
|
!define PRODUCT_NAME "CDM Server"
|
12
|
!define PRODUCT_VERSION "2.5"
|
13
|
!define PRODUCT_PUBLISHER "EDIT"
|
14
|
!define PRODUCT_WEB_SITE "http://wp5.e-taxonomy.eu/"
|
15
|
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
16
|
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
17
|
|
18
|
!define COPYRIGHT_FILE "..\templates\copyright.txt"
|
19
|
!define DATASOURCES_DIR "..\templates\.cdmLibrary\"
|
20
|
!define JAR_FILE "..\..\..\..\target\cdm-server-${PRODUCT_VERSION}.jar"
|
21
|
|
22
|
!define JAR_FILE_NAME "cdm-server-${PRODUCT_VERSION}.jar"
|
23
|
!define COPYRIGHT_FILE_NAME "copyright.txt"
|
24
|
|
25
|
; MUI 1.67 compatible ------
|
26
|
!include "MUI.nsh"
|
27
|
|
28
|
; MUI Settings
|
29
|
!define MUI_ABORTWARNING
|
30
|
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
|
31
|
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
32
|
|
33
|
; Language Selection Dialog Settings
|
34
|
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
|
35
|
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
|
36
|
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
|
37
|
|
38
|
; Welcome page
|
39
|
!insertmacro MUI_PAGE_WELCOME
|
40
|
; License page
|
41
|
!insertmacro MUI_PAGE_LICENSE ${COPYRIGHT_FILE}
|
42
|
; Directory page
|
43
|
!insertmacro MUI_PAGE_DIRECTORY
|
44
|
; Instfiles page
|
45
|
!insertmacro MUI_PAGE_INSTFILES
|
46
|
; Finish page
|
47
|
!insertmacro MUI_PAGE_FINISH
|
48
|
|
49
|
; Uninstaller pages
|
50
|
!insertmacro MUI_UNPAGE_INSTFILES
|
51
|
|
52
|
; Language files
|
53
|
!insertmacro MUI_LANGUAGE "English"
|
54
|
!insertmacro MUI_LANGUAGE "French"
|
55
|
!insertmacro MUI_LANGUAGE "German"
|
56
|
!insertmacro MUI_LANGUAGE "Spanish"
|
57
|
|
58
|
; MUI end ------
|
59
|
|
60
|
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
61
|
OutFile "${PRODUCT_NAME}-Setup.exe"
|
62
|
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
|
63
|
ShowInstDetails show
|
64
|
ShowUnInstDetails show
|
65
|
|
66
|
Function .onInit
|
67
|
!insertmacro MUI_LANGDLL_DISPLAY
|
68
|
FunctionEnd
|
69
|
|
70
|
Section "MainSection" SEC01
|
71
|
|
72
|
SetOutPath "$INSTDIR\"
|
73
|
SetOverwrite try
|
74
|
File "service\"
|
75
|
File "${DATASOURCES_DIR}"
|
76
|
SetOutPath "$INSTDIR\lib"
|
77
|
File ${JAR_FILE}
|
78
|
SetOutPath "$INSTDIR\license"
|
79
|
;File "cdmserver\license\license.txt"
|
80
|
File ${COPYRIGHT_FILE}
|
81
|
SectionEnd
|
82
|
|
83
|
Section -AdditionalIcons
|
84
|
SetOutPath $INSTDIR
|
85
|
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
|
86
|
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
|
87
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
|
88
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninst.exe"
|
89
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\cdmserver.lnk" "$INSTDIR\bin\cdmserver.exe"
|
90
|
SectionEnd
|
91
|
|
92
|
Section -Post
|
93
|
WriteUninstaller "$INSTDIR\uninst.exe"
|
94
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
95
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
|
96
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
97
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
98
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
99
|
SectionEnd
|
100
|
|
101
|
|
102
|
Function un.onUninstSuccess
|
103
|
HideWindow
|
104
|
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
|
105
|
FunctionEnd
|
106
|
|
107
|
Function un.onInit
|
108
|
!insertmacro MUI_UNGETLANGUAGE
|
109
|
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
|
110
|
Abort
|
111
|
FunctionEnd
|
112
|
|
113
|
Section Uninstall
|
114
|
Delete "$INSTDIR\${PRODUCT_NAME}.url"
|
115
|
Delete "$INSTDIR\uninst.exe"
|
116
|
;Delete "$INSTDIR\logs\cdmserverLog.txt"
|
117
|
Delete "$INSTDIR\license\${COPYRIGHT_FILE_NAME}"
|
118
|
Delete "$INSTDIR\libs\${JAR_FILE_NAME}"
|
119
|
Delete "$INSTDIR\libs\.cdmLibrary\datasources.xml"
|
120
|
Delete "$INSTDIR\bin\cdmserver.bat"
|
121
|
Delete "$INSTDIR\bin\cdmserver.exe"
|
122
|
|
123
|
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk"
|
124
|
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Website.lnk"
|
125
|
Delete "$SMPROGRAMS\${PRODUCT_NAME}\cdmserver.lnk"
|
126
|
|
127
|
RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
|
128
|
RMDir "$INSTDIR\logs"
|
129
|
RMDir "$INSTDIR\license"
|
130
|
RMDir "$INSTDIR\libs\.cdmLibrary"
|
131
|
RMDir "$INSTDIR\libs"
|
132
|
RMDir "$INSTDIR\bin"
|
133
|
|
134
|
Delete "$PROFILE\.cdmLibrary\datasources.xml"
|
135
|
RMDir "$PROFILE\.cdmLibrary"
|
136
|
|
137
|
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
138
|
SetAutoClose true
|
139
|
SectionEnd
|