Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Copyright 2004-2008 Josh Lee
- ShowInstDetails show
- ;=== BEGIN: BASIC INFORMATION
- !define NAME "UT3 Jail Break"
- !define DEFAULT_DESTINATION "$DOCUMENTS\My Games\Unreal Tournament 3\UTGame\Published\CookedPC"
- !define SHORTNAME "UT3JB"
- !define VERSION "1.0.0.0"
- !define FILENAME "UT3_JB_Alpha9"
- !define CHECKRUNNING "UT3.exe"
- !define CLOSENAME ""
- !define ADDONSDIRECTORYPRESERVE "NONE"
- !define JAILBREAKINSTALLERVERSION "1.0.0.0"
- !define INSTALLERCOMMENTS "For additional details, visit PlanetJailbreak.com xxx:todo"
- !define INSTALLERADDITIONALTRADEMARKS " PlanetJailbreak " ;end this entry with a period and a space if used
- !define INSTALLERLEGALCOPYRIGHT "PlanetJailbreak and contributors"
- !define LICENSEAGREEMENT "JBLicense.txt"
- ; NOTE: For no license agreement, comment out the above line by placing a semicolon at the start of it
- ;=== END: BASIC INFORMATION
- ;=== Program Details
- Name "${NAME}"
- OutFile "..\${FILENAME}_Installer.exe"
- InstallDir "${DEFAULT_DESTINATION}"
- Caption "${NAME} | Installer"
- VIProductVersion "${VERSION}"
- VIAddVersionKey ProductName "${NAME}"
- VIAddVersionKey Comments "${INSTALLERCOMMENTS}"
- VIAddVersionKey CompanyName "PlanetJailBreak.com"
- VIAddVersionKey LegalCopyright "${INSTALLERLEGALCOPYRIGHT}"
- VIAddVersionKey FileDescription "${NAME}"
- VIAddVersionKey FileVersion "${VERSION}"
- VIAddVersionKey ProductVersion "${VERSION}"
- VIAddVersionKey InternalName "${NAME}"
- VIAddVersionKey LegalTrademarks "${INSTALLERADDITIONALTRADEMARKS}PlanetJailbreak.com is a Trademark PlanetJailbreak"
- VIAddVersionKey OriginalFilename "${FILENAME}.paf.exe"
- VIAddVersionKey PlanetJailbreak.comInstallerVersion "${JAILBREAKINSTALLERVERSION}"
- ;=== Runtime Switches
- SetCompress Auto
- SetCompressor /SOLID lzma
- SetCompressorDictSize 32
- SetDatablockOptimize On
- CRCCheck on
- AutoCloseWindow True
- RequestExecutionLevel user
- AllowRootDirInstall True
- ;=== Include
- !include MUI.nsh
- !include FileFunc.nsh
- !include LogicLib.nsh
- !insertmacro DriveSpace
- !insertmacro GetOptions
- !insertmacro GetDrives
- !insertmacro GetRoot
- !insertmacro GetSize
- !insertmacro GetParent
- ;=== Program Icon
- Icon "JBIcon.ico"
- ;=== Icon & Stye ===
- !define MUI_ICON "JBIcon.ico"
- BrandingText "PlanetJailbreak.com - xxx:todo?"
- ;=== Pages
- !define MUI_WELCOMEFINISHPAGE_BITMAP "logo.bmp"
- !define MUI_WELCOMEPAGE_TITLE "${NAME}"
- !define MUI_WELCOMEPAGE_TEXT "$(welcome)"
- !insertmacro MUI_PAGE_WELCOME
- !define MUI_LICENSEPAGE_CHECKBOX
- !insertmacro MUI_PAGE_LICENSE "JBLicense.txt"
- !define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveDirectory
- !insertmacro MUI_PAGE_DIRECTORY
- !insertmacro MUI_PAGE_INSTFILES
- !define MUI_FINISHPAGE_TEXT "$(finish)"
- ;!define MUI_FINISHPAGE_RUN
- ;!define MUI_FINISHPAGE_RUN_TEXT "$(runtext)"
- ;!define MUI_FINISHPAGE_RUN_FUNCTION "RunOnFinish"
- !insertmacro MUI_PAGE_FINISH
- SubCaption 3 "Test"
- ;=== Languages
- !insertmacro MUI_LANGUAGE "English"
- LangString welcome ${LANG_ENGLISH} "This wizard will guide you through the installation of ${NAME}.\r\n\r\nIf you are upgrading an existing installation of ${NAME}, please close UT3 before proceeding.\r\n\r\nClick Next to continue."
- LangString finish ${LANG_ENGLISH} "${NAME} has been installed on your device.\r\n\r\nClick Finish to close this wizard."
- LangString runwarning ${LANG_ENGLISH} "Please close all instances of ${CLOSENAME} and then click OK. Jailbreak Mod can not be upgraded while it is running."
- LangString invaliddirectory ${LANG_ENGLISH} "The destination folder you selected is invalid. Please choose a valid folder."
- LangString notenoughspace ${LANG_ENGLISH} "The device you have selected to install to does not have enough free space for Jailbreak."
- LangString checkforplatform ${LANG_ENGLISH} "Checking for previous install of Jailbreak"
- LangString refreshmenu ${LANG_ENGLISH} "Refreshing Jailbreak Menu"
- ;LangString runtext ${LANG_ENGLISH} "Run your Jailbreak"
- ;=== Variables
- Var FOUNDJAILBREAKPATH
- Function .onInit
- ${GetOptions} "$CMDLINE" "/DESTINATION=" $R0
- IfErrors CheckLegacyDestination
- StrCpy $INSTDIR "$R0$"
- Goto InitDone
- CheckLegacyDestination:
- ClearErrors
- ${GetOptions} "$CMDLINE" "-o" $R0
- IfErrors NoDestination
- StrCpy $INSTDIR "$R0"
- Goto InitDone
- NoDestination:
- ClearErrors
- ${GetDrives} "HDD+FDD" GetDrivesCallBack
- StrCmp $FOUNDJAILBREAKPATH "" DefaultDestination
- StrCpy $INSTDIR "$FOUNDJAILBREAKPATH\"
- Goto InitDone
- DefaultDestination:
- StrCpy $INSTDIR "${DEFAULT_DESTINATION}"
- InitDone:
- FunctionEnd
- Function LeaveDirectory
- GetInstDirError $0
- ;=== Does it already exist? (upgrade)
- IfFileExists "$INSTDIR\Jailbreak.u" "" CheckInstallerError
- ;=== Check if app is running?
- StrCmp ${CHECKRUNNING} "NONE" CheckInstallerError
- FindProcDLL::FindProc "${CHECKRUNNING}"
- StrCmp $R0 "1" "" CheckInstallerError
- MessageBox MB_OK|MB_ICONINFORMATION "$(runwarning)"
- Abort
- CheckInstallerError:
- ${Switch} $0
- ${Case} 0 ;=== Valid directory and enough free space
- ${Break}
- ${Case} 1
- MessageBox MB_OK "$(invaliddirectory)"
- Abort
- ${Break}
- ${Case} 2
- IfFileExists "$INSTDIR" "" NotEnoughSpaceNoUpgrade ;=== Is upgrade
- SectionGetSize ${SectionMain} $1 ;=== Space Required for App
- ${GetRoot} "$INSTDIR" $2
- ${DriveSpace} "$2\" "/D=F /S=K" $3 ;=== Space Free on Device
- ${GetSize} "$INSTDIR" "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size
- IntOp $7 $3 + $4 ;=== Space Free + Current Install Size
- CalculateSpaceLeft:
- IntCmp $7 $1 NotEnoughSpaceNoUpgrade NotEnoughSpaceNoUpgrade
- Goto EndNotEnoughSpace
- NotEnoughSpaceNoUpgrade:
- MessageBox MB_OK "$(notenoughspace)"
- Abort
- EndNotEnoughSpace:
- ${Break}
- ${EndSwitch}
- FunctionEnd
- Function GetDrivesCallBack
- ;=== Skip usual floppy letters
- StrCmp $8 "FDD" "" CheckForJailBreakPath
- StrCmp $9 "A:\" End
- StrCmp $9 "B:\" End
- StrCmp $9 "D:\" End
- StrCmp $9 "E:\" End
- StrCmp $9 "F:\" End
- CheckForJailBreakPath:
- IfFileExists "$9JailBreak" "" End
- StrCpy $FOUNDJAILBREAKPATH "$9JailBreak"
- End:
- Push $0
- FunctionEnd
- Function RunOnFinish
- ;Exec "$INSTDIR\JailBreak.exe"
- FunctionEnd
- Section "!Portable (required)"
- ; SetOutPath $INSTDIR
- File "Published\CookedPC\Jailbreak\*.*"
- SetOutPath "$INSTDIR\My Games*.*"
- File /r "Published\CookedPC\Jailbreak\*.*"
- ; File "Published\CookedPC\Jailbreak\Maps\*.*"
- ; SetOutPath "$INSTDIR\Maps\*.*"
- ; File /r "Published\CookedPC\Jailbreak\Maps\*.*"
- ;=== BEGIN: POST-INSTALL CODE
- ;=== END: POST-INSTALL CODE
- /*
- SetDocumentFolderAttributes:
- SetFileAttributes "$INSTDIR\Documents" SYSTEM
- SetFileAttributes "$INSTDIR\Documents\My Music" SYSTEM
- SetFileAttributes "$INSTDIR\Documents\My Pictures" SYSTEM
- SetFileAttributes "$INSTDIR\Documents\My Videos" SYSTEM
- SetFileAttributes "$INSTDIR\lib" SYSTEM|HIDDEN
- SetFileAttributes "$INSTDIR\Documents\desktop.ini" SYSTEM|HIDDEN
- SetFileAttributes "$INSTDIR\Documents\My Music\desktop.ini" SYSTEM|HIDDEN
- SetFileAttributes "$INSTDIR\Documents\My Pictures\desktop.ini" SYSTEM|HIDDEN
- SetFileAttributes "$INSTDIR\Documents\My Videos\desktop.ini" SYSTEM|HIDDEN
- SetFileAttributes "$INSTDIR\bin\desktop.ini" SYSTEM|HIDDEN
- SetFileAttributes "$INSTDIR\autorun.inf" NORMAL
- */
- ;=== Refresh PlanetJailbreak.com Menu (not final version)
- ${GetParent} "$INSTDIR" $0
- ;=== Check that it exists at the right location
- DetailPrint "$(checkforplatform)"
- IfFileExists "$0\JailBreak.u" "" TheEnd
- ;=== Check that it's the real deal so we aren't hanging with no response
- MoreInfo::GetProductName "$0\JailBreak.u"
- Pop $1
- StrCmp $1 "JailBreak.com" "" TheEnd
- MoreInfo::GetCompanyName "$0\JailBreak.u"
- Pop $1
- StrCmp $1 "JailBreak.com" "" TheEnd
- ;=== Check that it's running
- FindProcDLL::FindProc "${CHECKRUNNING}"
- StrCmp $R0 "1" "" TheEnd
- ;=== Send message for the Menu to refresh
- StrCpy $2 "JailBreakWindowMessageToRefresh$0\$CHECKRUNNING"
- System::Call "user32::RegisterWindowMessage(t r2) i .r3"
- DetailPrint "$(refreshmenu)"
- SendMessage 65535 $3 0 0
- TheEnd:
- SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement