SqueakBot1.2-script du package Windows

From OFSET Wiki

Jump to: navigation, search

A utiliser avec NSIS http://nsis.sourceforge.net/Main_Page

; SqueakBot.nsi 
;--------------------------------

; The name of the installer
Name "SqueakBot v.1.2"

; The file to write
OutFile "squeakbot-1.2.exe"

; The default installation directory
InstallDir $PROGRAMFILES\SqueakBot

; Registry key to check for directory (so if you install again, it will 
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\SqueakBot" "Install_Dir"

LoadLanguageFile "${NSISDIR}\Contrib\Language files\French.nlf"


XPStyle on

;--------------------------------

; Pages

Page components
Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles

;--------------------------------

; The stuff to install
Section "SqueakBot (requis)"

 SectionIn RO
 
 ; Set output path to the installation directory.
 SetOutPath $INSTDIR
 
 ; Put file there
 File "SqueakBot-1.2-3.8-6665-fr.image"
 File "SqueakBot-1.2-3.8-6665-fr.changes"
 File "Squeak.exe"
 File "Aspic.png"
 File "smec.gif"
 File "miniSmec.gif"
 File "SqueakFFIPrims.dll"
 File "Lisezmoi.txt"

 SetOutPath $SYSDIR
 File "io.dll"
 
 ; Write the installation path into the registry
 WriteRegStr HKLM SOFTWARE\SqueakBot "Install_Dir" "$INSTDIR"
 
 ; Write the uninstall keys for Windows
 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SqueakBot" "DisplayName" "SqueakBot v.1.2"
 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SqueakBot" "UninstallString" '"$INSTDIR\uninstall.exe"'
 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "NoModify" 1
 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "NoRepair" 1
 WriteUninstaller "uninstall.exe"
 
SectionEnd

; Optional section (can be disabled by the user)
Section "Raccourcis dans le menu Démarrer"

 CreateDirectory "$SMPROGRAMS\SqueakBot"
 CreateShortCut "$SMPROGRAMS\SqueakBot\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
 CreateShortCut "$SMPROGRAMS\SqueakBot\Lancer SqueakBot.lnk" "$INSTDIR\Squeak.exe" "$INSTDIR\SqueakBot-1.2-3.8-6665-fr.image" "$INSTDIR\Squeak.exe" 0
 CreateShortCut "$SMPROGRAMS\SqueakBot\A lire en cas de problemes.lnk" "$INSTDIR\Lisezmoi.txt" "" "$INSTDIR\Lisezmoi.txt" 0
 
SectionEnd

Section "Raccourcis sur le bureau"

 CreateShortCut "$DESKTOP\Lancer SqueakBot.lnk" "$INSTDIR\Squeak.exe" "$INSTDIR\SqueakBot-1.2-3.8-6665-fr.image" "$INSTDIR\Squeak.exe" 0
 
SectionEnd

;--------------------------------

; Uninstaller

Section "Uninstall"
 
 ; Remove registry keys
 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SqueakBot"
 DeleteRegKey HKLM SOFTWARE\SqueakBot

 ; Remove files and uninstaller
 Delete $INSTDIR\*.*

 ; Remove shortcuts, if any
 Delete "$SMPROGRAMS\SqueakBot\*.*"
 Delete "$DESKTOP\Lancer SqueakBot.lnk"

 ; Remove directories used
 RMDir "$SMPROGRAMS\SqueakBot"
 RMDir "$INSTDIR"

SectionEnd
Personal tools