Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Copyright 2004-2008 Josh Lee
  2.  
  3. ShowInstDetails show
  4.  
  5. ;=== BEGIN: BASIC INFORMATION
  6. !define NAME "UT3 Jail Break"
  7. !define DEFAULT_DESTINATION "$DOCUMENTS\My Games\Unreal Tournament 3\UTGame\Published\CookedPC"
  8. !define SHORTNAME "UT3JB"
  9. !define VERSION "1.0.0.0"
  10. !define FILENAME "UT3_JB_Alpha9"
  11. !define CHECKRUNNING "UT3.exe"
  12. !define CLOSENAME ""
  13. !define ADDONSDIRECTORYPRESERVE "NONE"
  14. !define JAILBREAKINSTALLERVERSION "1.0.0.0"
  15. !define INSTALLERCOMMENTS "For additional details, visit PlanetJailbreak.com xxx:todo"
  16. !define INSTALLERADDITIONALTRADEMARKS " PlanetJailbreak " ;end this entry with a period and a space if used
  17. !define INSTALLERLEGALCOPYRIGHT "PlanetJailbreak and contributors"
  18. !define LICENSEAGREEMENT "JBLicense.txt"
  19. ; NOTE: For no license agreement, comment out the above line by placing a semicolon at the start of it
  20. ;=== END: BASIC INFORMATION
  21.  
  22. ;=== Program Details
  23. Name "${NAME}"
  24. OutFile "..\${FILENAME}_Installer.exe"
  25. InstallDir "${DEFAULT_DESTINATION}"
  26. Caption "${NAME} | Installer"
  27. VIProductVersion "${VERSION}"
  28. VIAddVersionKey ProductName "${NAME}"
  29. VIAddVersionKey Comments "${INSTALLERCOMMENTS}"
  30. VIAddVersionKey CompanyName "PlanetJailBreak.com"
  31. VIAddVersionKey LegalCopyright "${INSTALLERLEGALCOPYRIGHT}"
  32. VIAddVersionKey FileDescription "${NAME}"
  33. VIAddVersionKey FileVersion "${VERSION}"
  34. VIAddVersionKey ProductVersion "${VERSION}"
  35. VIAddVersionKey InternalName "${NAME}"
  36. VIAddVersionKey LegalTrademarks "${INSTALLERADDITIONALTRADEMARKS}PlanetJailbreak.com is a Trademark PlanetJailbreak"
  37. VIAddVersionKey OriginalFilename "${FILENAME}.paf.exe"
  38. VIAddVersionKey PlanetJailbreak.comInstallerVersion "${JAILBREAKINSTALLERVERSION}"
  39.  
  40. ;=== Runtime Switches
  41. SetCompress Auto
  42. SetCompressor /SOLID lzma
  43. SetCompressorDictSize 32
  44. SetDatablockOptimize On
  45. CRCCheck on
  46. AutoCloseWindow True
  47. RequestExecutionLevel user
  48. AllowRootDirInstall True
  49.  
  50. ;=== Include
  51. !include MUI.nsh
  52. !include FileFunc.nsh
  53. !include LogicLib.nsh
  54. !insertmacro DriveSpace
  55. !insertmacro GetOptions
  56. !insertmacro GetDrives
  57. !insertmacro GetRoot
  58. !insertmacro GetSize
  59. !insertmacro GetParent
  60.  
  61. ;=== Program Icon
  62. Icon "JBIcon.ico"
  63.  
  64. ;=== Icon & Stye ===
  65. !define MUI_ICON "JBIcon.ico"
  66. BrandingText "PlanetJailbreak.com - xxx:todo?"
  67.  
  68. ;=== Pages
  69. !define MUI_WELCOMEFINISHPAGE_BITMAP "logo.bmp"
  70. !define MUI_WELCOMEPAGE_TITLE "${NAME}"
  71. !define MUI_WELCOMEPAGE_TEXT "$(welcome)"
  72. !insertmacro MUI_PAGE_WELCOME
  73. !define MUI_LICENSEPAGE_CHECKBOX
  74. !insertmacro MUI_PAGE_LICENSE "JBLicense.txt"
  75. !define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveDirectory
  76. !insertmacro MUI_PAGE_DIRECTORY
  77. !insertmacro MUI_PAGE_INSTFILES
  78. !define MUI_FINISHPAGE_TEXT "$(finish)"
  79. ;!define MUI_FINISHPAGE_RUN
  80. ;!define MUI_FINISHPAGE_RUN_TEXT "$(runtext)"
  81. ;!define MUI_FINISHPAGE_RUN_FUNCTION "RunOnFinish"
  82. !insertmacro MUI_PAGE_FINISH
  83. SubCaption 3 "Test"
  84. ;=== Languages
  85. !insertmacro MUI_LANGUAGE "English"
  86.  
  87. 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."
  88. LangString finish ${LANG_ENGLISH} "${NAME} has been installed on your device.\r\n\r\nClick Finish to close this wizard."
  89. LangString runwarning ${LANG_ENGLISH} "Please close all instances of ${CLOSENAME} and then click OK.  Jailbreak Mod can not be upgraded while it is running."
  90. LangString invaliddirectory ${LANG_ENGLISH} "The destination folder you selected is invalid.  Please choose a valid folder."
  91. LangString notenoughspace ${LANG_ENGLISH} "The device you have selected to install to does not have enough free space for Jailbreak."
  92. LangString checkforplatform ${LANG_ENGLISH} "Checking for previous install of Jailbreak"
  93. LangString refreshmenu ${LANG_ENGLISH} "Refreshing Jailbreak Menu"
  94. ;LangString runtext ${LANG_ENGLISH} "Run your Jailbreak"
  95.  
  96. ;=== Variables
  97. Var FOUNDJAILBREAKPATH
  98.  
  99. Function .onInit
  100.     ${GetOptions} "$CMDLINE" "/DESTINATION=" $R0
  101.  
  102.     IfErrors CheckLegacyDestination
  103.         StrCpy $INSTDIR "$R0$"
  104.         Goto InitDone
  105.  
  106.     CheckLegacyDestination:
  107.         ClearErrors
  108.         ${GetOptions} "$CMDLINE" "-o" $R0
  109.         IfErrors NoDestination
  110.             StrCpy $INSTDIR "$R0"
  111.             Goto InitDone
  112.  
  113.     NoDestination:
  114.         ClearErrors
  115.         ${GetDrives} "HDD+FDD" GetDrivesCallBack
  116.         StrCmp $FOUNDJAILBREAKPATH "" DefaultDestination
  117.             StrCpy $INSTDIR "$FOUNDJAILBREAKPATH\"
  118.             Goto InitDone
  119.        
  120.     DefaultDestination:
  121.         StrCpy $INSTDIR "${DEFAULT_DESTINATION}"
  122.  
  123.     InitDone:
  124. FunctionEnd
  125.  
  126. Function LeaveDirectory
  127.     GetInstDirError $0
  128.  
  129.     ;=== Does it already exist? (upgrade)
  130.     IfFileExists "$INSTDIR\Jailbreak.u" "" CheckInstallerError
  131.         ;=== Check if app is running?
  132.         StrCmp ${CHECKRUNNING} "NONE" CheckInstallerError
  133.             FindProcDLL::FindProc "${CHECKRUNNING}"
  134.             StrCmp $R0 "1" "" CheckInstallerError
  135.                 MessageBox MB_OK|MB_ICONINFORMATION "$(runwarning)"
  136.                 Abort
  137.  
  138.  
  139.     CheckInstallerError:
  140.         ${Switch} $0
  141.             ${Case} 0 ;=== Valid directory and enough free space
  142.                 ${Break}
  143.             ${Case} 1
  144.                 MessageBox MB_OK "$(invaliddirectory)"
  145.                 Abort
  146.                 ${Break}
  147.             ${Case} 2
  148.                 IfFileExists "$INSTDIR" "" NotEnoughSpaceNoUpgrade ;=== Is upgrade
  149.                     SectionGetSize ${SectionMain} $1 ;=== Space Required for App
  150.                     ${GetRoot} "$INSTDIR" $2
  151.                     ${DriveSpace} "$2\" "/D=F /S=K" $3 ;=== Space Free on Device
  152.                     ${GetSize} "$INSTDIR" "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size
  153.                     IntOp $7 $3 + $4 ;=== Space Free + Current Install Size
  154.  
  155.                 CalculateSpaceLeft:
  156.                     IntCmp $7 $1 NotEnoughSpaceNoUpgrade NotEnoughSpaceNoUpgrade
  157.                     Goto EndNotEnoughSpace
  158.  
  159.                 NotEnoughSpaceNoUpgrade:
  160.                     MessageBox MB_OK "$(notenoughspace)"
  161.                     Abort
  162.  
  163.                 EndNotEnoughSpace:
  164.                 ${Break}
  165.         ${EndSwitch}
  166. FunctionEnd
  167.  
  168. Function GetDrivesCallBack
  169.     ;=== Skip usual floppy letters
  170.     StrCmp $8 "FDD" "" CheckForJailBreakPath
  171.     StrCmp $9 "A:\" End
  172.     StrCmp $9 "B:\" End
  173.     StrCmp $9 "D:\" End
  174.     StrCmp $9 "E:\" End
  175.     StrCmp $9 "F:\" End
  176.     CheckForJailBreakPath:
  177.         IfFileExists "$9JailBreak" "" End
  178.             StrCpy $FOUNDJAILBREAKPATH "$9JailBreak"
  179.  
  180.     End:
  181.         Push $0
  182. FunctionEnd
  183.  
  184.  
  185. Function RunOnFinish
  186.     ;Exec "$INSTDIR\JailBreak.exe"
  187. FunctionEnd
  188.  
  189.  
  190. Section "!Portable (required)"
  191. ;   SetOutPath $INSTDIR
  192.  
  193.     File "Published\CookedPC\Jailbreak\*.*"
  194.     SetOutPath "$INSTDIR\My Games*.*"
  195.     File /r "Published\CookedPC\Jailbreak\*.*"
  196.    
  197. ;   File "Published\CookedPC\Jailbreak\Maps\*.*"
  198. ;   SetOutPath "$INSTDIR\Maps\*.*"
  199. ;   File /r "Published\CookedPC\Jailbreak\Maps\*.*"
  200.    
  201.     ;=== BEGIN: POST-INSTALL CODE
  202.     ;=== END: POST-INSTALL CODE
  203.     /*
  204.     SetDocumentFolderAttributes:
  205.         SetFileAttributes "$INSTDIR\Documents" SYSTEM
  206.         SetFileAttributes "$INSTDIR\Documents\My Music" SYSTEM
  207.         SetFileAttributes "$INSTDIR\Documents\My Pictures" SYSTEM
  208.         SetFileAttributes "$INSTDIR\Documents\My Videos" SYSTEM
  209.         SetFileAttributes "$INSTDIR\lib" SYSTEM|HIDDEN
  210.         SetFileAttributes "$INSTDIR\Documents\desktop.ini" SYSTEM|HIDDEN
  211.         SetFileAttributes "$INSTDIR\Documents\My Music\desktop.ini" SYSTEM|HIDDEN
  212.         SetFileAttributes "$INSTDIR\Documents\My Pictures\desktop.ini" SYSTEM|HIDDEN
  213.         SetFileAttributes "$INSTDIR\Documents\My Videos\desktop.ini" SYSTEM|HIDDEN
  214.         SetFileAttributes "$INSTDIR\bin\desktop.ini" SYSTEM|HIDDEN
  215.         SetFileAttributes "$INSTDIR\autorun.inf" NORMAL
  216.     */
  217.     ;=== Refresh PlanetJailbreak.com Menu (not final version)
  218.     ${GetParent} "$INSTDIR" $0
  219.     ;=== Check that it exists at the right location
  220.     DetailPrint "$(checkforplatform)"
  221.     IfFileExists "$0\JailBreak.u" "" TheEnd
  222.         ;=== Check that it's the real deal so we aren't hanging with no response
  223.         MoreInfo::GetProductName "$0\JailBreak.u"
  224.         Pop $1
  225.         StrCmp $1 "JailBreak.com" "" TheEnd
  226.         MoreInfo::GetCompanyName "$0\JailBreak.u"
  227.         Pop $1
  228.         StrCmp $1 "JailBreak.com" "" TheEnd
  229.        
  230.         ;=== Check that it's running
  231.         FindProcDLL::FindProc "${CHECKRUNNING}"
  232.         StrCmp $R0 "1" "" TheEnd
  233.        
  234.         ;=== Send message for the Menu to refresh
  235.         StrCpy $2 "JailBreakWindowMessageToRefresh$0\$CHECKRUNNING"
  236.         System::Call "user32::RegisterWindowMessage(t r2) i .r3"
  237.         DetailPrint "$(refreshmenu)"
  238.         SendMessage 65535 $3 0 0
  239.     TheEnd:
  240. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement