/[ascend]/trunk/pygtk/create.nsi
ViewVC logotype

Annotation of /trunk/pygtk/create.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 628 - (hide annotations) (download)
Wed May 24 01:45:02 2006 UTC (18 years ago) by johnpye
File size: 4230 byte(s)
Fixed up standard paths stuff to use 'INSTALL_ASCDATA' as the place where tcltk/python/models etc
will live. The confusion here came from the fact that I was taking 'INSTALL_SHARE' to be be assumed
to mean 'the location of /usr/share' -- hence the resulting '$INSTALL_SHARE/ascend' that was bothering
Ben. The 'INSTALL_ASCDATA' fixes this, and behaves as he will like, I hope.

Also note that I have switched the default situation in config.h.in to use relative paths by default,
which is the preferred CMU way. SCons builds will default to absolute paths on non-Windows systems.
1 johnpye 357 ; example2.nsi
2     ;
3 johnpye 628 ; This script is based on example1.nsi, but it remembers the directory,
4 johnpye 357 ; has uninstall support and (optionally) installs start menu shortcuts.
5     ;
6     ; It will install example2.nsi into a directory that the user selects,
7    
8     ;--------------------------------
9    
10     ; The name of the installer
11     Name "ASCEND PyGTK"
12    
13     ; The file to write
14 johnpye 578 !ifdef OUTFILE
15     OutFile ${OUTFILE}.exe
16     !else
17     OutFile ascend-setup.exe
18     !endif
19 johnpye 357
20 johnpye 465
21 johnpye 578 SetCompressor /SOLID lzma
22    
23 johnpye 357 ; The default installation directory
24     InstallDir $PROGRAMFILES\ASCEND
25    
26     ; Registry key to check for directory (so if you install again, it will
27     ; overwrite the old one automatically)
28     InstallDirRegKey HKLM "Software\ASCEND" "Install_Dir"
29    
30     ;--------------------------------
31    
32     ; Pages
33    
34     Page components
35     Page directory
36     Page instfiles
37    
38     UninstPage uninstConfirm
39     UninstPage instfiles
40    
41     ;--------------------------------
42    
43     ; The stuff to install
44     Section "ASCEND (required)"
45    
46     SectionIn RO
47    
48     ; Set output path to the installation directory.
49     SetOutPath $INSTDIR
50    
51 johnpye 603 ; Python interface
52 johnpye 463 File "_ascpy.dll"
53 johnpye 534 File "..\ascend.dll"
54 johnpye 357 File "config.py"
55     File "*.py"
56     SetOutPath $INSTDIR\glade
57 johnpye 463 File "glade\*.glade"
58     File "glade\*.png"
59 johnpye 603
60     ; Model Library
61 johnpye 357 SetOutPath $INSTDIR\models
62 johnpye 627 File /r /x .svn "..\models\*.a4*"
63     File /r /x .svn "..\models\*.bz2"
64 johnpye 603
65     ; Tcl/Tk interface
66     SetOutPath $INSTDIR\tcltk
67 johnpye 627 File /r /x .svn "..\tcltk\TK\*"
68 johnpye 603 SetOutPath $INSTDIR
69     File "..\tcltk\generic\interface\ascendtcl.dll"
70     File "..\tcltk\generic\interface\ascend4.exe"
71    
72 johnpye 357 SetOutPath $INSTDIR
73     File "Makefile.bt"
74     File "ascend.syn"
75 johnpye 603
76     ; Set 'librarypath' in .ascend.ini
77 johnpye 357 WriteINIstr $APPDATA\.ascend.ini Directories librarypath "$DOCUMENTS\ascdata;$INSTDIR\models"
78 johnpye 603
79     ; Create 'ascend.bat' launcher for PyGTK interface
80 johnpye 455 ClearErrors
81     FileOpen $0 $INSTDIR\ascend.bat w
82     IfErrors done
83     FileWrite $0 "@echo off"
84     FileWriteByte $0 "13"
85     FileWriteByte $0 "10"
86 johnpye 465 FileWrite $0 "set PATH=c:\Python24;c:\GTK\bin"
87     FileWriteByte $0 "13"
88     FileWriteByte $0 "10"
89 johnpye 455 FileWrite $0 "cd "
90     FileWrite $0 $INSTDIR
91     FileWriteByte $0 "13"
92     FileWriteByte $0 "10"
93 johnpye 627 FileWrite $0 "c:\Python24\python gtkbrowser.py %1 %2 %3 %4 %5 %6 %7 %8"
94 johnpye 455 FileWriteByte $0 "13"
95     FileWriteByte $0 "10"
96    
97     FileClose $0
98     done:
99 johnpye 357
100     ; Write the installation path into the registry
101     WriteRegStr HKLM SOFTWARE\ASCEND "Install_Dir" "$INSTDIR"
102    
103     ; Write the uninstall keys for Windows
104     WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "DisplayName" "ASCEND Simulation Environment"
105     WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "UninstallString" '"$INSTDIR\uninstall.exe"'
106     WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoModify" 1
107     WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoRepair" 1
108     WriteUninstaller "uninstall.exe"
109    
110     SectionEnd
111    
112     ; Optional section (can be disabled by the user)
113     Section "Start Menu Shortcuts"
114    
115     CreateDirectory "$SMPROGRAMS\ASCEND"
116     CreateShortCut "$SMPROGRAMS\ASCEND\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
117     CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND.lnk" "$INSTDIR\ascend.bat" "" "$INSTDIR\ascend.bat" 0
118 johnpye 603 CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND Tcl/Tk.lnk" "$INSTDIR\ascend4.exe" "" "$INSTDIR\ascend4.exe" 0
119 johnpye 357
120     SectionEnd
121    
122     ;--------------------------------
123    
124     ; Uninstaller
125    
126     Section "Uninstall"
127    
128     ; Remove registry keys
129     DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND"
130     DeleteRegKey HKLM SOFTWARE\ASCEND
131    
132     ; Remove files and uninstaller
133 johnpye 603 Delete $INSTDIR\_ascpy.dll
134     Delete $INSTDIR\ascendtcl.dll
135     Delete $INSTDIR\ascend.dll
136 johnpye 357 Delete $INSTDIR\ascend.bat
137     Delete $INSTDIR\*.py
138     Delete $INSTDIR\glade\*
139     Delete $INSTDIR\Makefile.bt
140     Delete $INSTDIR\ascend.syn
141     Delete $INSTDIR\models\*
142 johnpye 603 Delete $INSTDIR\models\johnpye\*
143     RMDir /r $INSTDIR\tcltk
144 johnpye 357 RMDir $INSTDIR\models\johnpye
145     RMDIR $INSTDIR\models
146    
147     ; Remove shortcuts, if any
148     Delete "$SMPROGRAMS\ASCEND\*.*"
149    
150     ; Remove directories used
151     RMDir "$SMPROGRAMS\ASCEND"
152     RMDir "$INSTDIR"
153    
154     SectionEnd

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22