blob: 17664e40d3d309f182118bef2582e7ada62cc7d2 (
plain)
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
|
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "QuteMol"
!define PRODUCT_VERSION "0.4.1"
!define PRODUCT_PUBLISHER "Visual Computing Lab, ISTI - CNR"
!define PRODUCT_WEB_SITE "http://qutemol.sourceforge.net"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\qutemol.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define DEVCPPDIR "C:\Dev-Cpp\bin"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
XPStyle on
Function .onInit
# the plugins dir is automatically deleted when the installer exits
InitPluginsDir
#File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp"
File /oname=$PLUGINSDIR\splash.bmp "installsplash.bmp"
#optional
#File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav"
splash::show 1500 $PLUGINSDIR\splash
Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normally, and '-1' if some error occurred.
FunctionEnd
!macro BIMAGE IMAGE PARMS
Push $0
GetTempFileName $0
File /oname=$0 "${IMAGE}"
SetBrandingImage ${PARMS} $0
Delete $0
Pop $0
!macroend
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "license.txt"
; License page
!insertmacro MUI_PAGE_LICENSE "citeware.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\qutemol.exe"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "installsplash.bmp" ; optional
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "QuteMolSetup.exe"
; Adds an XP manifest to the installer
; Add branding image to the installer (an image placeholder on the side).
; It is not enough to just add the placeholder, we must set the image too...
; We will later set the image in every pre-page function.
; We can also set just one persistent image in .onGUIInit
;AddBrandingImage left 100
InstallDir "$PROGRAMFILES\VCG\QuteMol"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Section "MainSection" SEC01
; File /oname=$PLUGINSDIR\splash.bmp "installsplash.bmp"
; SetBrandingImage splash /RESIZETOFIT
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "gpl.txt"
File "readme.txt"
File "whatsnew.txt"
File "art_example.txt"
File "..\qutemol.exe"
; File "${DEVCPPDIR}\MINGWM10.dll"
; File "${DEVCPPDIR}\GLEW32.dll"
; File "${DEVCPPDIR}\JPEG62.dll"
; File "${DEVCPPDIR}\LIBPNG13.dll"
; File "${DEVCPPDIR}\ZLIB1.dll"
CreateDirectory "$SMPROGRAMS\QuteMol"
CreateShortCut "$SMPROGRAMS\QuteMol\QuteMol.lnk" "$INSTDIR\qutemol.exe"
CreateShortCut "$DESKTOP\QuteMol.lnk" "$INSTDIR\qutemol.exe"
SetOutPath "$INSTDIR\sample"
File "..\sample\porin.pdb"
File "..\sample\caffeine.pdb"
File "..\sample\testosterone.pdb"
SetOutPath "$INSTDIR\image"
File "..\image\*.png"
SetOutPath "$INSTDIR\presets"
File "..\presets\*.preset"
SectionEnd
Section -AdditionalIcons
SetOutPath $INSTDIR
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\QuteMol\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\QuteMol\Uninstall.lnk" "$INSTDIR\uninst.exe"
CreateShortCut "$SMPROGRAMS\QuteMol\QuteMol Configuration.lnk" notepad.exe "$INSTDIR\QuteMol.cfg"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\qutemol.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\qutemol.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\sample\*.pdb"
Delete "$INSTDIR\sample\*.png"
Delete "$INSTDIR\image\*.png"
Delete "$INSTDIR\presets\*.preset"
Delete "$INSTDIR\qutemol.exe"
Delete "$INSTDIR\*.txt"
Delete "$INSTDIR\*.dll"
Delete "$INSTDIR\qutemol.cfg"
Delete "$DESKTOP\QuteMol.lnk"
Delete "$SMPROGRAMS\QuteMol\Uninstall.lnk"
Delete "$SMPROGRAMS\QuteMol\Website.lnk"
Delete "$SMPROGRAMS\QuteMol\QuteMol.lnk"
Delete "$SMPROGRAMS\QuteMol\QuteMol Configuration.lnk"
RMDir "$SMPROGRAMS\QuteMol"
RMDir "$INSTDIR\sample"
RMDir "$INSTDIR\presets"
RMDir "$INSTDIR\image"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
|