| 1 |
; 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 "_ascpy.dll" |
| 46 |
File "..\..\ascend.dll" |
| 47 |
File "config.py" |
| 48 |
File "*.py" |
| 49 |
SetOutPath $INSTDIR\glade |
| 50 |
File "glade\*.glade" |
| 51 |
File "glade\*.png" |
| 52 |
SetOutPath $INSTDIR\models |
| 53 |
File "..\..\models\*.a4c" |
| 54 |
File "..\..\models\*.a4l" |
| 55 |
SetOutPath $INSTDIR\models\johnpye |
| 56 |
File "..\..\models\johnpye\*.a4c" |
| 57 |
SetOutPath $INSTDIR |
| 58 |
File "Makefile.bt" |
| 59 |
File "ascend.syn" |
| 60 |
|
| 61 |
WriteINIstr $APPDATA\.ascend.ini Directories librarypath "$DOCUMENTS\ascdata;$INSTDIR\models" |
| 62 |
|
| 63 |
ClearErrors |
| 64 |
FileOpen $0 $INSTDIR\ascend.bat w |
| 65 |
IfErrors done |
| 66 |
FileWrite $0 "@echo off" |
| 67 |
FileWriteByte $0 "13" |
| 68 |
FileWriteByte $0 "10" |
| 69 |
FileWrite $0 "cd " |
| 70 |
FileWrite $0 $INSTDIR |
| 71 |
FileWriteByte $0 "13" |
| 72 |
FileWriteByte $0 "10" |
| 73 |
FileWrite $0 "c:\Python24\python gtkbrowser.py" |
| 74 |
FileWriteByte $0 "13" |
| 75 |
FileWriteByte $0 "10" |
| 76 |
|
| 77 |
FileClose $0 |
| 78 |
done: |
| 79 |
|
| 80 |
|
| 81 |
; Write the installation path into the registry |
| 82 |
WriteRegStr HKLM SOFTWARE\ASCEND "Install_Dir" "$INSTDIR" |
| 83 |
|
| 84 |
; Write the uninstall keys for Windows |
| 85 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "DisplayName" "ASCEND Simulation Environment" |
| 86 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "UninstallString" '"$INSTDIR\uninstall.exe"' |
| 87 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoModify" 1 |
| 88 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoRepair" 1 |
| 89 |
WriteUninstaller "uninstall.exe" |
| 90 |
|
| 91 |
SectionEnd |
| 92 |
|
| 93 |
; Optional section (can be disabled by the user) |
| 94 |
Section "Start Menu Shortcuts" |
| 95 |
|
| 96 |
CreateDirectory "$SMPROGRAMS\ASCEND" |
| 97 |
CreateShortCut "$SMPROGRAMS\ASCEND\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
| 98 |
CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND.lnk" "$INSTDIR\ascend.bat" "" "$INSTDIR\ascend.bat" 0 |
| 99 |
|
| 100 |
SectionEnd |
| 101 |
|
| 102 |
;-------------------------------- |
| 103 |
|
| 104 |
; Uninstaller |
| 105 |
|
| 106 |
Section "Uninstall" |
| 107 |
|
| 108 |
; Remove registry keys |
| 109 |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" |
| 110 |
DeleteRegKey HKLM SOFTWARE\ASCEND |
| 111 |
|
| 112 |
; Remove files and uninstaller |
| 113 |
Delete $INSTDIR\_ascend.dll |
| 114 |
Delete $INSTDIR\ascend.bat |
| 115 |
Delete $INSTDIR\*.py |
| 116 |
Delete $INSTDIR\glade\* |
| 117 |
Delete $INSTDIR\Makefile.bt |
| 118 |
Delete $INSTDIR\ascend.syn |
| 119 |
Delete $INSTDIR\models\* |
| 120 |
Delete $INSTDIR\models\johnpye\* |
| 121 |
RMDir $INSTDIR\models\johnpye |
| 122 |
RMDIR $INSTDIR\models |
| 123 |
|
| 124 |
; Remove shortcuts, if any |
| 125 |
Delete "$SMPROGRAMS\ASCEND\*.*" |
| 126 |
|
| 127 |
; Remove directories used |
| 128 |
RMDir "$SMPROGRAMS\ASCEND" |
| 129 |
RMDir "$INSTDIR" |
| 130 |
|
| 131 |
SectionEnd |