Frozen Bubble: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (→Screenshots) |
(word-wrapping →The Script) |
||
Line 36: | Line 36: | ||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" | !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" | ||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen Bubble" | !define MUI_STARTMENUPAGE_REGISTRY_KEY \ | ||
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen Bubble" | |||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" | !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" | ||
!define MUI_STARTMENUPAGE_VARIABLE $R9 | !define MUI_STARTMENUPAGE_VARIABLE $R9 | ||
Line 66: | Line 67: | ||
Pop $0 | Pop $0 | ||
StrCmp $0 0 checkSDL | StrCmp $0 0 checkSDL | ||
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "The installer can not find Perl and SDL_perl on this computer!$\r$\nPlease install Perl and SDL_perl and run this installer again.$\r$\nPress cancel if you are sure you have Perl and SDL_Perl installed.$\r$\n$\r$\nWould you like the installer to open Perl's download page for you?" IDNO abort IDCANCEL splash | MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "The installer can not find Perl and \ | ||
ExecShell open http://www.activestate.com/Products/Download/Get.plex?id=ActivePerl | SDL_perl on this computer!$\r$\nPlease install Perl and SDL_perl and run this \ | ||
MessageBox MB_OK|MB_ICONINFORMATION "Please make sure you download Perl 5.6.*. The current version of SDL_Perl doesn't work with Perl 5.8.*." IDOK abort | installer again.$\r$\nPress cancel if you are sure you have Perl and SDL_Perl \ | ||
installed.$\r$\n$\r$\nWould you like the installer to open Perl's download page \ | |||
for you?" IDNO abort IDCANCEL splash | |||
ExecShell open \ | |||
http://www.activestate.com/Products/Download/Get.plex?id=ActivePerl | |||
MessageBox MB_OK|MB_ICONINFORMATION "Please make sure you download Perl 5.6.*. \ | |||
The current version of SDL_Perl doesn't work with Perl 5.8.*." IDOK abort | |||
checkSDL: | checkSDL: | ||
Line 76: | Line 83: | ||
ReadRegStr $0 HKLM Software\SDL_Perl Install_Dir | ReadRegStr $0 HKLM Software\SDL_Perl Install_Dir | ||
IfFileExists $0 0 install_SDL_Perl | IfFileExists $0 0 install_SDL_Perl | ||
MessageBox MB_YESNO|MB_ICONEXCLAMATION `It seems that you have installed SDL_Perl but didn't add it to Perl's package list.$\r$\nTo add it to Perl's package list you must call "ppm install SDL_perl.ppd". Would you like the installer to call it for you?` IDNO abort | MessageBox MB_YESNO|MB_ICONEXCLAMATION `It seems that you have installed \ | ||
SDL_Perl but didn't add it to Perl's package list.$\r$\nTo add it to Perl's \ | |||
package list you must call "ppm install SDL_perl.ppd". Would you like the \ | |||
installer to call it for you?` IDNO abort | |||
SetOutPath $0 | SetOutPath $0 | ||
ExecWait "ppm install SDL_perl.ppd" $1 | ExecWait "ppm install SDL_perl.ppd" $1 | ||
StrCmp $1 0 splash | StrCmp $1 0 splash | ||
MessageBox MB_OK|MB_ICONSTOP "Installation failed. Please install SDL_Perl manually and run this installer again." IDOK abort | MessageBox MB_OK|MB_ICONSTOP "Installation failed. Please install \ | ||
SDL_Perl manually and run this installer again." IDOK abort | |||
install_SDL_Perl: | install_SDL_Perl: | ||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "The installer can not find SDL_Perl on this computer!$\r$\nPlease install SDL_Perl and run this installer again.$\r$\n$\r$\nWould you like the installer to open SDL_Perl's download page for you?" IDNO abort | MessageBox MB_YESNO|MB_ICONEXCLAMATION "The installer can not find SDL_Perl \ | ||
on this computer!$\r$\nPlease install SDL_Perl and run this installer \ | |||
again.$\r$\n$\r$\nWould you like the installer to open SDL_Perl's download \ | |||
page for you?" IDNO abort | |||
ExecShell open http://www.sdlperl.org/index.htpl?id=0&cat=projects | ExecShell open http://www.sdlperl.org/index.htpl?id=0&cat=projects | ||
Goto abort | Goto abort | ||
Line 126: | Line 140: | ||
StrCmp $5 "" 0 +2 | StrCmp $5 "" 0 +2 | ||
StrCpy $5 perl.exe | StrCpy $5 perl.exe | ||
CreateShortcut "$INSTDIR\Frozen Bubble.lnk" $5 "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico | CreateShortcut "$INSTDIR\Frozen Bubble.lnk" $5 \ | ||
"-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico | |||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen Bubble" DisplayName "Frozen Bubble" | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen \ | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen Bubble" UninstallString '"$INSTDIR\Uninstall.exe"' | Bubble" DisplayName "Frozen Bubble" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen Bubble" DisplayIcon $INSTDIR\gfx\icon.ico | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen \ | ||
Bubble" UninstallString '"$INSTDIR\Uninstall.exe"' | |||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen \ | |||
Bubble" DisplayIcon $INSTDIR\gfx\icon.ico | |||
WriteUninstaller $INSTDIR\Uninstall.exe | WriteUninstaller $INSTDIR\Uninstall.exe | ||
SectionEnd | SectionEnd | ||
Line 143: | Line 161: | ||
createIcons: | createIcons: | ||
CreateShortcut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Frozen Bubble.lnk" $5 "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico | CreateShortcut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Frozen Bubble.lnk" \ | ||
CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk $INSTDIR\Uninstall.exe | $5 "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico | ||
CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\License.lnk $INSTDIR\COPYING.txt | CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk \ | ||
CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Readme.lnk $INSTDIR\README.txt | $INSTDIR\Uninstall.exe | ||
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Windows Port.lnk" "$INSTDIR\Windows Port.txt" | CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\License.lnk \ | ||
$INSTDIR\COPYING.txt | |||
CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Readme.lnk \ | |||
$INSTDIR\README.txt | |||
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Windows Port.lnk" \ | |||
"$INSTDIR\Windows Port.txt" | |||
!insertmacro MUI_STARTMENU_WRITE_END | !insertmacro MUI_STARTMENU_WRITE_END | ||
SectionEnd | SectionEnd | ||
Section "Desktop icon" SecDesktop | Section "Desktop icon" SecDesktop | ||
CreateShortcut "$DESKTOP\Frozen Bubble.lnk" $5 "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico | CreateShortcut "$DESKTOP\Frozen Bubble.lnk" $5 \ | ||
"-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico | |||
SectionEnd | SectionEnd | ||
Section "Quick Launch icon" SecQuick | Section "Quick Launch icon" SecQuick | ||
StrCmp $QUICKLAUNCH $TEMP +2 | StrCmp $QUICKLAUNCH $TEMP +2 | ||
CreateShortcut "$QUICKLAUNCH\Frozen Bubble.lnk" $5 "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico | CreateShortcut "$QUICKLAUNCH\Frozen Bubble.lnk" $5 \ | ||
"-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico | |||
SectionEnd | SectionEnd | ||
Line 173: | Line 198: | ||
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN | !insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN | ||
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Game files" | !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Game files" | ||
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "An icon of Frozen Bubble on the desktop" | !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "An icon of Frozen Bubble \ | ||
!insertmacro MUI_DESCRIPTION_TEXT ${SecQuick} "An icon of Frozen Bubble in the Quick Launch bar" | on the desktop" | ||
!insertmacro MUI_DESCRIPTION_TEXT ${SecScript} "This installer scripts (requires NSIS)" | !insertmacro MUI_DESCRIPTION_TEXT ${SecQuick} "An icon of Frozen Bubble \ | ||
in the Quick Launch bar" | |||
!insertmacro MUI_DESCRIPTION_TEXT ${SecScript} "This installer scripts \ | |||
(requires NSIS)" | |||
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END | !insertmacro MUI_FUNCTIONS_DESCRIPTION_END | ||
Line 205: | Line 233: | ||
RMDir $INSTDIR | RMDir $INSTDIR | ||
ReadRegStr $0 "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}" | ReadRegStr $0 "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" \ | ||
"${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}" | |||
StrCmp $0 "" noshortcuts | StrCmp $0 "" noshortcuts |
Revision as of 10:18, 22 April 2005
Description
This is my script for the Win32 port of Frozen Bubble. Frozen Bubble is an addictive game for one or two players. It's written in Perl (yes, you've heard me... Perl!) and SDL.
Screenshots
The Script
; Frozen Bubble Win32 port installer script ; This script requires NSIS 2.0b3 and above ; http://nsis.sf.net ; ; Written by Amir Szekely #SetCompressor bzip2 !define MUI_PRODUCT "Frozen Bubble" !define MUI_VERSION "1.0.0" !include "MUI.nsh" ;-------------------------------- ;Configuration !define MUI_FINISHPAGE !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Frozen Bubble.lnk" !define MUI_LICENSEPAGE !define MUI_COMPONENTSPAGE !define MUI_DIRECTORYPAGE !define MUI_ABORTWARNING !define MUI_UNCONFIRMPAGE !define MUI_UNINSTALLER !define MUI_STARTMENUPAGE !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" !define MUI_STARTMENUPAGE_REGISTRY_KEY \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen Bubble" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !define MUI_STARTMENUPAGE_VARIABLE $R9 !define MUI_HEADERBITMAP "branding.bmp" ;Language !define MUI_TEXT_FINISH_SHOWREADME "Run ${MUI_PRODUCT}" !insertmacro MUI_LANGUAGE "English" ;General OutFile "Frozen Bubble.exe" ;License page LicenseData "license.rtf" ;Folder-selection page InstallDir "$PROGRAMFILES\${MUI_PRODUCT}" ;-------------------------------- ;Check for Perl and SDL_Perl and show splash screen Function .onInit Banner::show /NOUNLOAD "Checking for Perl and SDL_Perl..." ReadRegStr $0 HKLM Software\Perl BinDir StrCmp $5 "" 0 +2 StrCpy $5 perl.exe nsExec::Exec '"$5" -v' Pop $0 StrCmp $0 0 checkSDL MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "The installer can not find Perl and \ SDL_perl on this computer!$\r$\nPlease install Perl and SDL_perl and run this \ installer again.$\r$\nPress cancel if you are sure you have Perl and SDL_Perl \ installed.$\r$\n$\r$\nWould you like the installer to open Perl's download page \ for you?" IDNO abort IDCANCEL splash ExecShell open \ http://www.activestate.com/Products/Download/Get.plex?id=ActivePerl MessageBox MB_OK|MB_ICONINFORMATION "Please make sure you download Perl 5.6.*. \ The current version of SDL_Perl doesn't work with Perl 5.8.*." IDOK abort checkSDL: nsExec::Exec '"$5" -e "use SDL; print $$SDL::VERSION;"' Pop $0 StrCmp $0 0 splash ReadRegStr $0 HKLM Software\SDL_Perl Install_Dir IfFileExists $0 0 install_SDL_Perl MessageBox MB_YESNO|MB_ICONEXCLAMATION `It seems that you have installed \ SDL_Perl but didn't add it to Perl's package list.$\r$\nTo add it to Perl's \ package list you must call "ppm install SDL_perl.ppd". Would you like the \ installer to call it for you?` IDNO abort SetOutPath $0 ExecWait "ppm install SDL_perl.ppd" $1 StrCmp $1 0 splash MessageBox MB_OK|MB_ICONSTOP "Installation failed. Please install \ SDL_Perl manually and run this installer again." IDOK abort install_SDL_Perl: MessageBox MB_YESNO|MB_ICONEXCLAMATION "The installer can not find SDL_Perl \ on this computer!$\r$\nPlease install SDL_Perl and run this installer \ again.$\r$\n$\r$\nWould you like the installer to open SDL_Perl's download \ page for you?" IDNO abort ExecShell open http://www.sdlperl.org/index.htpl?id=0&cat=projects Goto abort splash: Banner::destroy File /oname=$PLUGINSDIR\splash.bmp splash.bmp File /oname=$PLUGINSDIR\splash.wav ..\snd\malus.wav advsplash::show 1800 350 187 -1 $PLUGINSDIR\splash Pop $0 ; $0 has '1' if the user closed the splash screen early, ; '0' if everything closed normal, and '-1' if some error occurred. Return abort: Banner::destroy Abort FunctionEnd ;-------------------------------- ;Installer Sections Section "!Frozen Bubble" SecCore SectionIn RO SetOutPath $INSTDIR File ..\AUTHORS.txt File ..\CHANGES.txt File ..\COPYING.txt File ..\README.txt File "..\Windows Port.txt" File ..\frozen-bubble File ..\frozen-bubble-editor File /r ..\gfx File /r ..\lib File /r ..\snd File /r ..\data File /r ..\doc StrCmp $5 perl.exe 0 +2 SearchPath $5 perl.exe StrCmp $5 "" 0 +2 StrCpy $5 perl.exe CreateShortcut "$INSTDIR\Frozen Bubble.lnk" $5 \ "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen \ Bubble" DisplayName "Frozen Bubble" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen \ Bubble" UninstallString '"$INSTDIR\Uninstall.exe"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen \ Bubble" DisplayIcon $INSTDIR\gfx\icon.ico WriteUninstaller $INSTDIR\Uninstall.exe SectionEnd Section -StartMenu !insertmacro MUI_STARTMENU_WRITE_BEGIN SetShellVarContext all CreateDirectory $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE} IfFileExists $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE} createIcons SetShellVarContext current CreateDirectory $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE} createIcons: CreateShortcut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Frozen Bubble.lnk" \ $5 "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk \ $INSTDIR\Uninstall.exe CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\License.lnk \ $INSTDIR\COPYING.txt CreateShortCut $SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Readme.lnk \ $INSTDIR\README.txt CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Windows Port.lnk" \ "$INSTDIR\Windows Port.txt" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd Section "Desktop icon" SecDesktop CreateShortcut "$DESKTOP\Frozen Bubble.lnk" $5 \ "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico SectionEnd Section "Quick Launch icon" SecQuick StrCmp $QUICKLAUNCH $TEMP +2 CreateShortcut "$QUICKLAUNCH\Frozen Bubble.lnk" $5 \ "-I.\lib frozen-bubble" $INSTDIR\gfx\icon.ico SectionEnd Section "Install script" SecScript SetOutPath $INSTDIR\install File "Frozen Bubble.nsi" File license.rtf File splash.bmp File branding.bmp SectionEnd ;-------------------------------- ;Descriptions !insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Game files" !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "An icon of Frozen Bubble \ on the desktop" !insertmacro MUI_DESCRIPTION_TEXT ${SecQuick} "An icon of Frozen Bubble \ in the Quick Launch bar" !insertmacro MUI_DESCRIPTION_TEXT ${SecScript} "This installer scripts \ (requires NSIS)" !insertmacro MUI_FUNCTIONS_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" Delete $INSTDIR\AUTHORS.txt Delete $INSTDIR\CHANGES.txt Delete $INSTDIR\COPYING.txt Delete $INSTDIR\README.txt Delete "$INSTDIR\Windows Port.txt" Delete $INSTDIR\frozen-bubble Delete $INSTDIR\frozen-bubble-editor Delete "$INSTDIR\Frozen Bubble.lnk" Delete $INSTDIR\.fbrc Delete $INSTDIR\.fbhighscores Delete $INSTDIR\.fbhighlevelshistory Delete $INSTDIR\Uninstall.exe RMDir /r $INSTDIR\gfx RMDir /r $INSTDIR\lib RMDir /r $INSTDIR\snd RMDir /r $INSTDIR\data RMDir /r $INSTDIR\install RMDir /r $INSTDIR\doc RMDir /r $INSTDIR\.fblevels RMDir $INSTDIR ReadRegStr $0 "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" \ "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}" StrCmp $0 "" noshortcuts Delete "$0\Frozen Bubble.lnk" Delete $0\Uninstall.lnk Delete $0\License.lnk Delete $0\Readme.lnk Delete "$0\Windows Port.lnk" RMDir $0 noshortcuts: DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frozen Bubble" Delete "$DESKTOP\Frozen Bubble.lnk" Delete "$QUICKLAUNCH\Frozen Bubble.lnk" SectionEnd ;eof
Page author: KiCHiK