File: install.nsi

package info (click to toggle)
openstructure 2.9.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 205,228 kB
  • sloc: cpp: 188,129; python: 35,361; ansic: 34,298; fortran: 3,275; sh: 286; xml: 146; makefile: 29
file content (138 lines) | stat: -rw-r--r-- 3,685 bytes parent folder | download | duplicates (4)
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
; NSIS script for DNG 
; Juergen Haas <juergen.haas@unibas.ch>
; Nov 2009
;=========================
  
; The name of the program
!define PRODUCT_NAME "openstructure"
!define PRODUCT_NAME_SMALL "dng"
!define PRODUCT_VERSION "0.9.0"
Name "${PRODUCT_NAME} v${PRODUCT_VERSION}"

; Installer filename
OutFile "dng_win32.exe"

;=========================

    LicenseText "If you accept the terms of the agreement, click I Agree to continue.\ 
	You must accept the agreement to install ${PRODUCT_NAME_SMALL} v${PRODUCT_VERSION}" 
    LicenseData "LICENSE.txt"
    Page license 
	
	DirText "Setup will install ${PRODUCT_NAME_SMALL} v${PRODUCT_VERSION} in the following folder.\ 
    To install in a different folder, click, browse and select another folder. Please do not choose\
	a path containing blank spaces as it will make ${PRODUCT_NAME} not work properly. Click Install to start the installation"
	InstallDir "C:\${PRODUCT_NAME_SMALL}"
    Page directory 
	
	;Page components
	
	ShowInstDetails Show
	ShowUninstDetails Show	
    Page instfiles
	

;=========================
;Sections
;=========================


Section "" ;No components page, name is not important

SetOutPath $INSTDIR
File "README"
Rename $INSTDIR\README $INSTDIR\README.txt

SetOutPath "$INSTDIR\bin"
File ".\stage\bin\*" 

SetOutPath "$INSTDIR\examples"
File ".\examples\entity\test_query.py"

WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd


 ; The uninstall section
Section "Uninstall"

;Exec "$INSTDIR\bin\unassoc.bat"

DeleteRegValue HKEY_CLASSES_ROOT ".pdb" ""
DeleteRegValue HKEY_CLASSES_ROOT ".pdb\DefaultIcon" ""
DeleteRegValue HKEY_CLASSES_ROOT ".pdb\Shell" ""
DeleteRegValue HKEY_CLASSES_ROOT ".pdb\Shell\Open" ""
DeleteRegValue HKEY_CLASSES_ROOT ".pdb\Shell\Open\Command" ""


DeleteRegKey HKCR ".pdb"

Delete "$INSTDIR\bin\*.*"
Delete "$INSTDIR\src\*.*"
Delete "$INSTDIR\examples\*.*"

RMDir "$INSTDIR"

RMDir "$INSTDIR\examples\entity"
RMDir "$INSTDIR\examples"

Delete "$SMPROGRAMS\${PRODUCT_NAME_SMALL}\dng.lnk"
Delete "$SMPROGRAMS\${PRODUCT_NAME_SMALL}\dng_cl.lnk"
Delete "$SMPROGRAMS\${PRODUCT_NAME_SMALL}\uninstall.lnk"
RMDir "$SMPROGRAMS\${PRODUCT_NAME_SMALL}"

Delete "$INSTDIR\README.txt"
Delete "$INSTDIR\README"


RMDir $INSTDIR

SectionEnd

Section "Shortcut in Start Menu"

SetOutPath "$INSTDIR\win32"

CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME_SMALL}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME_SMALL}\dng.lnk" "$INSTDIR\bin\dng.exe" "" "$INSTDIR\dng.ico"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME_SMALL}\dng_cl.lnk" "$INSTDIR\bin\dng_cl.exe"
CreateShortCut "$DESKTOP\dng.lnk" "$INSTDIR\bin\dng.exe" "" "$INSTDIR\win32\dng.ico"


CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME_SMALL}\uninstall.lnk" "$INSTDIR\Uninstall.exe" 
SectionEnd

Section "pdb file association"

;Exec "$INSTDIR\assoc.bat"

WriteRegStr HKEY_CLASSES_ROOT ".pdb" "" ""
WriteRegStr HKEY_CLASSES_ROOT ".pdb\DefaultIcon" "" "$INSTDIR\dng.ico"
WriteRegStr HKEY_CLASSES_ROOT ".pdb\Shell" "" ""
WriteRegStr HKEY_CLASSES_ROOT ".pdb\Shell\Open" "" ""
WriteRegStr HKEY_CLASSES_ROOT ".pdb\Shell\Open\Command" "" "$INSTDIR\dng_load.py $\"%1$\""

SectionEnd

;=========================
;Functions
;=========================

#Function .onInit
#FunctionEnd
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