| 1 |
johnpye |
357 |
; example2.nsi |
| 2 |
|
|
; |
| 3 |
|
|
; This script is based on example1.nsi, but it remember the directory, |
| 4 |
|
|
; 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 |
|
|
OutFile "ascend-0.9.6.exe" |
| 15 |
|
|
|
| 16 |
|
|
; The default installation directory |
| 17 |
|
|
InstallDir $PROGRAMFILES\ASCEND |
| 18 |
|
|
|
| 19 |
|
|
; Registry key to check for directory (so if you install again, it will |
| 20 |
|
|
; overwrite the old one automatically) |
| 21 |
|
|
InstallDirRegKey HKLM "Software\ASCEND" "Install_Dir" |
| 22 |
|
|
|
| 23 |
|
|
;-------------------------------- |
| 24 |
|
|
|
| 25 |
|
|
; Pages |
| 26 |
|
|
|
| 27 |
|
|
Page components |
| 28 |
|
|
Page directory |
| 29 |
|
|
Page instfiles |
| 30 |
|
|
|
| 31 |
|
|
UninstPage uninstConfirm |
| 32 |
|
|
UninstPage instfiles |
| 33 |
|
|
|
| 34 |
|
|
;-------------------------------- |
| 35 |
|
|
|
| 36 |
|
|
; The stuff to install |
| 37 |
|
|
Section "ASCEND (required)" |
| 38 |
|
|
|
| 39 |
|
|
SectionIn RO |
| 40 |
|
|
|
| 41 |
|
|
; Set output path to the installation directory. |
| 42 |
|
|
SetOutPath $INSTDIR |
| 43 |
|
|
|
| 44 |
|
|
; Put file there |
| 45 |
|
|
File "_ascend.dll" |
| 46 |
johnpye |
455 |
|
| 47 |
johnpye |
357 |
File "config.py" |
| 48 |
|
|
File "*.py" |
| 49 |
|
|
SetOutPath $INSTDIR\glade |
| 50 |
|
|
File "glade\*" |
| 51 |
|
|
SetOutPath $INSTDIR\models |
| 52 |
|
|
File "..\..\models\*.a4c" |
| 53 |
|
|
File "..\..\models\*.a4l" |
| 54 |
|
|
SetOutPath $INSTDIR\models\johnpye |
| 55 |
|
|
File "..\..\models\johnpye\*.a4c" |
| 56 |
|
|
SetOutPath $INSTDIR |
| 57 |
|
|
File "Makefile.bt" |
| 58 |
|
|
File "ascend.syn" |
| 59 |
|
|
|
| 60 |
|
|
WriteINIstr $APPDATA\.ascend.ini Directories librarypath "$DOCUMENTS\ascdata;$INSTDIR\models" |
| 61 |
johnpye |
455 |
|
| 62 |
|
|
ClearErrors |
| 63 |
|
|
FileOpen $0 $INSTDIR\ascend.bat w |
| 64 |
|
|
IfErrors done |
| 65 |
|
|
FileWrite $0 "@echo off" |
| 66 |
|
|
FileWriteByte $0 "13" |
| 67 |
|
|
FileWriteByte $0 "10" |
| 68 |
|
|
FileWrite $0 "cd " |
| 69 |
|
|
FileWrite $0 $INSTDIR |
| 70 |
|
|
FileWriteByte $0 "13" |
| 71 |
|
|
FileWriteByte $0 "10" |
| 72 |
|
|
FileWrite $0 "c:\Python24\python gtkbrowser.py" |
| 73 |
|
|
FileWriteByte $0 "13" |
| 74 |
|
|
FileWriteByte $0 "10" |
| 75 |
|
|
|
| 76 |
|
|
FileClose $0 |
| 77 |
|
|
done: |
| 78 |
|
|
|
| 79 |
johnpye |
357 |
|
| 80 |
|
|
; Write the installation path into the registry |
| 81 |
|
|
WriteRegStr HKLM SOFTWARE\ASCEND "Install_Dir" "$INSTDIR" |
| 82 |
|
|
|
| 83 |
|
|
; Write the uninstall keys for Windows |
| 84 |
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "DisplayName" "ASCEND Simulation Environment" |
| 85 |
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "UninstallString" '"$INSTDIR\uninstall.exe"' |
| 86 |
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoModify" 1 |
| 87 |
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoRepair" 1 |
| 88 |
|
|
WriteUninstaller "uninstall.exe" |
| 89 |
|
|
|
| 90 |
|
|
SectionEnd |
| 91 |
|
|
|
| 92 |
|
|
; Optional section (can be disabled by the user) |
| 93 |
|
|
Section "Start Menu Shortcuts" |
| 94 |
|
|
|
| 95 |
|
|
CreateDirectory "$SMPROGRAMS\ASCEND" |
| 96 |
|
|
CreateShortCut "$SMPROGRAMS\ASCEND\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
| 97 |
|
|
CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND.lnk" "$INSTDIR\ascend.bat" "" "$INSTDIR\ascend.bat" 0 |
| 98 |
|
|
|
| 99 |
|
|
SectionEnd |
| 100 |
|
|
|
| 101 |
|
|
;-------------------------------- |
| 102 |
|
|
|
| 103 |
|
|
; Uninstaller |
| 104 |
|
|
|
| 105 |
|
|
Section "Uninstall" |
| 106 |
|
|
|
| 107 |
|
|
; Remove registry keys |
| 108 |
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" |
| 109 |
|
|
DeleteRegKey HKLM SOFTWARE\ASCEND |
| 110 |
|
|
|
| 111 |
|
|
; Remove files and uninstaller |
| 112 |
|
|
Delete $INSTDIR\_ascend.dll |
| 113 |
|
|
Delete $INSTDIR\ascend.bat |
| 114 |
|
|
Delete $INSTDIR\*.py |
| 115 |
|
|
Delete $INSTDIR\glade\* |
| 116 |
|
|
Delete $INSTDIR\Makefile.bt |
| 117 |
|
|
Delete $INSTDIR\ascend.syn |
| 118 |
|
|
Delete $INSTDIR\models\* |
| 119 |
|
|
Delete $INSTDIR\models\johnpye\* |
| 120 |
|
|
RMDir $INSTDIR\models\johnpye |
| 121 |
|
|
RMDIR $INSTDIR\models |
| 122 |
|
|
|
| 123 |
|
|
; Remove shortcuts, if any |
| 124 |
|
|
Delete "$SMPROGRAMS\ASCEND\*.*" |
| 125 |
|
|
|
| 126 |
|
|
; Remove directories used |
| 127 |
|
|
RMDir "$SMPROGRAMS\ASCEND" |
| 128 |
|
|
RMDir "$INSTDIR" |
| 129 |
|
|
|
| 130 |
|
|
SectionEnd |