-
Notifications
You must be signed in to change notification settings - Fork 1
/
nsisscript.nsi.in
153 lines (120 loc) · 6.18 KB
/
nsisscript.nsi.in
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
;--------------------------------
;Product Info
Name "__PROGRAM__ __VERSION__" ;Define your own software name here
!define PRODUCT "__PROGRAM__" ;Define your own software name here
!define VERSION "__VERSION__" ;Define your own software version here
CRCCheck On
; Script create for version 2.0b4 1.40 (from 09.sep.03) with GUI NSIS (c) by Dirk Paehl. Thank you for use my program
!include "MUI.nsh"
!include "x64.nsh"
Function .onInit
${If} ${RunningX64}
${EnableX64FSRedirection}
${else}
MessageBox MB_OK "Sorry this version only runs on windows 64 bit. Download the 32bit version"
Abort
${EndIf}
FunctionEnd
; For icon association
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
Function RefreshShellIcons
; By jerome tremblay - april 2003
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
(${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
FunctionEnd
;--------------------------------
;Configuration
OutFile "__OUTFILE__"
;Folder selection page
InstallDir "$PROGRAMFILES64\${PRODUCT} ${VERSION}"
;Remember install folder
InstallDirRegKey HKCU "Software\${PRODUCT} ${VERSION}" ""
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE ".\PyMca.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!define MUI_ABORTWARNING
;--------------------------------
;Language
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Icon "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
Icon ".\icons\PyMca.ico"
UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
;Installer Sections
Section "section_1" section_1
SetOutPath "$INSTDIR"
FILE /r "__SOURCE_DIRECTORY__\*.*"
SectionEnd
Section Shortcuts
SetOutPath "$PROFILE"
Call RefreshShellIcons
CreateDirectory "$SMPROGRAMS\${PRODUCT} ${VERSION}"
WriteIniStr "$INSTDIR\PyMca.url" "InternetShortcut" "URL" "http://pymca.sourceforge.net/"
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\PyMca Home page.lnk" "$INSTDIR\PyMca.url" "" "$INSTDIR\PyMca.url" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\PyMca.lnk" "$INSTDIR\PyMcaMain.exe" "" "$INSTDIR\PyMcaMain.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\PyMca Fresh Start.lnk" "$INSTDIR\PyMcaMain.exe" "-f" "$INSTDIR\PyMcaMain.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\Identify Peak.lnk" "$INSTDIR\PeakIdentifier.exe" "" "$INSTDIR\PeakIdentifier.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\Elements.lnk" "$INSTDIR\ElementsInfo.exe" "" "$INSTDIR\ElementsInfo.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\PyMcaBatch.lnk" "$INSTDIR\PyMcaBatch.exe" "" "$INSTDIR\PyMcaBatch.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\EDF Viewer.lnk" "$INSTDIR\EdfFileSimpleViewer.exe" "" "$INSTDIR\EdfFileSimpleViewer.exe" 0
;CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\Fit to Spec Converter.lnk" "$INSTDIR\Fit2Spec.exe" "" "$INSTDIR\Fit2Spec.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\Mca to Edf Converter.lnk" "$INSTDIR\Mca2Edf.exe" "" "$INSTDIR\Mca2Edf.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\RGB Correlator.lnk" "$INSTDIR\PyMcaPostBatch.exe" "" "$INSTDIR\PyMcaPostBatch.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\ROI Imaging Tool.lnk" "$INSTDIR\QStackWidget.exe" "" "$INSTDIR\QStackWidget.exe" 0
#CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\ROI Imaging Tool (OLD).lnk" "$INSTDIR\QStackWidget.exe" "--old" "$INSTDIR\QStackWidget.exe" 0
;CreateShortCut "$SMPROGRAMS\${PRODUCT}${VERSION}\EDF Binning Tool.lnk" "$INSTDIR\EdfBinWidget.exe" "" "$INSTDIR\EdfBinWidget.exe" 0
;CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\Xia Correction Tool.lnk" "$INSTDIR\XiaCorrect.exe" "" "$INSTDIR\XiaCorrect.exe" 0
SectionEnd
Section Uninstaller
CreateShortCut "$SMPROGRAMS\${PRODUCT} ${VERSION}\Uninstall.lnk" "$INSTDIR\uninst.exe" "" "$INSTDIR\uninst.exe" 0
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT} ${VERSION}" "DisplayName" "${PRODUCT} ${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT} ${VERSION}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT} ${VERSION}" "URLInfoAbout" "http://pymca.sourceforge.net"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT} ${VERSION}" "Publisher" "V.A. Solé - ESRF Software Group"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT} ${VERSION}" "UninstallString" "$INSTDIR\Uninst.exe"
WriteRegStr HKCU "Software\${PRODUCT} ${VERSION}" "" $INSTDIR
WriteUninstaller "$INSTDIR\Uninst.exe"
SectionEnd
;--------------------------------
;Descriptions
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;Add your stuff here
;Delete Files
Delete "$INSTDIR\mpl-data\*.*"
Delete "$INSTDIR\.matplotlib\*.*"
Delete "$INSTDIR\attdata\*.*"
Delete "$INSTDIR\HTML\IMAGES\*.*"
Delete "$INSTDIR\HTML\PyMCA_files\*.*"
Delete "$INSTDIR\HTML\*.*"
Delete "$INSTDIR\*.*"
;Delete Start Menu Shortcuts
Delete "$SMPROGRAMS\PyMca ${VERSION}\*.*"
RmDir "$SMPROGRAMS\PyMca ${VERSION}"
SetShellVarContext all
Delete "$SMPROGRAMS\PyMca ${VERSION}\*.*"
RmDir "$SMPROGRAMS\PyMca ${VERSION}"
;Delete Uninstaller And Unistall Registry Entries
DeleteRegKey HKEY_CLASSES_ROOT "Applications\PyMcaPostBatch.exe"
DeleteRegKey HKEY_CLASSES_ROOT "Applications\QEDFStackWidget.exe"
DeleteRegKey HKEY_CLASSES_ROOT "Applications\EdfFileSimpleViewer.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\PyMca ${VERSION}"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PyMca ${VERSION}"
DeleteRegKey HKEY_CURRENT_USER "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\PyMca ${VERSION}"
DeleteRegKey HKEY_CURRENT_USER "SOFTWARE\PyMca ${VERSION}"
RMDir "$INSTDIR\mpl-data"
RMDir "$INSTDIR\.matplotlib"
RMDir "$INSTDIR\attdata"
RMDir "$INSTDIR\HTML\IMAGES"
RMDir "$INSTDIR\HTML\PyMCA_files"
RMDir "$INSTDIR\HTML"
RMDir /r "$INSTDIR"
SectionEnd
;eof