Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;PEOM Install Script
- ;============================================================================
- ; DEFINITIONS -- adding these allows you to use them as "shortcuts" later on
- !define PRODUCT_NAME "Priority Earth Overhaul Mod"
- !define PRODUCT_VERSION "1.5.2"
- ;=============================================================================
- ; HEADER FILES -- add various functionalities to your installer; these .nsh files must be in your NSIS directory
- ; Modern User Interface (MUI) -- Allows use of the "typical" Windows installer interface most people are familiar with
- !include "MUI.nsh"
- ; InstallOptions -- Allows for creation of Custom Pages
- !include "InstallOptions.nsh"
- ; Logic Library -- Allows If/Then/Else functionality
- !include "LogicLib.nsh"
- ; nsDialogs -- Allows for special dialogue windows to be created
- !include "nsDialogs.nsh"
- ; WinMessages
- !include "winmessages.nsh"
- ; WinImage -- Removes the 2GB limit in NSIS
- Unicode True
- RequestExecutionLevel Admin
- ; Use LZMA compression
- ; Allows you to open archive with 7z maybe
- SetCompressor BZIP2
- ;===============================================================================
- ; MUI CONFIG -- sets up the appearance of each page of the installer via MUI definitions; relative paths ("..\graphics_docs\icon_v1.ico") should always be used
- !define MUI_ABORTWARNING
- !define MUI_HEADERIMAGE
- !define MUI_WELCOMEPAGE_TITLE_3LINES
- !define MUI_ICON "Icons\peom.ico"
- !define MUI_HEADERIMAGE_BITMAP "Icons\peomheader.bmp"
- !define MUI_WELCOMEFINISHPAGE_BITMAP "Icons\peomwelcome.bmp"
- !define MUI_WELCOMEPAGE_TITLE "Welcome to the Priority Earth Overhaul Mod Stage ${PRODUCT_VERSION} Install Wizard!"
- !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Priority Earth Overhaul Mod Stage ${PRODUCT_VERSION}.\r\n\r\nClick Next to continue."
- !define MUI_DIRECTORYPAGE_TEXT_TOP "Please verify the installer has correctly detected your Mass Effect 3 installation folder. If the location below is incorrect, please change it manually. Click Install when ready."
- !define MUI_LICENSEPAGE_TEXT_TOP "Please read our FAQ regarding mod compatibility and installation."
- ;!define MUI_COMPONENTSPAGE_TEXT_TOP "Please select which components you wish to install. Click Next when finished."
- ;!define MUI_COMPONENTSPAGE_TEXT_COMPLIST "NOTE: SELECT ONLY ONE ENDING COMPATIBILITY COMPONENT! Selecting multiple will cause severe incompatibility bugs. Only choose the one that is relevant to your mod list. "
- !define MUI_COMPONENTSPAGE_NODESC
- !define MUI_CUSTOMFUNCTION_GUIINIT onguiinit
- !define MUI_FINISHPAGE_TITLE "Installation Successful!"
- !define MUI_FINISHPAGE_TEXT "Thank you for installing Priority Earth Overhaul Mod Stage ${PRODUCT_VERSION}!\r\n\r\nClick Finish to close this window."
- ;============================================================================================
- ; OTHER
- BrandingText "PEOM Installer v${PRODUCT_VERSION}"
- ;the above re-defines the standard "NullSoft Install System" that appears toward the bottom left of the installer window, to whatever you specify
- ;============================================================================================
- ; PAGES -- all pages for your installer must be listed here, in the order that you want them to appear; included are two custom pages
- !insertmacro MUI_PAGE_WELCOME
- !define MUI_PAGE_CUSTOMFUNCTION_PRE pagecbcmpnorm
- !define MUI_LICENSEPAGE_CHECKBOX
- !insertmacro MUI_PAGE_LICENSE "readme.rtf"
- !define MUI_PAGE_CUSTOMFUNCTION_PRE pagecbcmpplugin
- !define MUI_PAGE_CUSTOMFUNCTION_SHOW pagecbcmppluginshow
- !define MUI_PAGE_CUSTOMFUNCTION_LEAVE pagecbcmppluginleave
- !insertmacro MUI_PAGE_COMPONENTS
- !insertmacro MUI_PAGE_DIRECTORY
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_PAGE_FINISH
- ;==============================================================================
- ; LANGUAGES -- self explanatory
- !insertmacro MUI_LANGUAGE "English"
- ;======================================================================================
- ; INSTALLATION PARAMETERS -- This is where are the files for installation are specified and the file name of the installer.
- Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
- OutFile "Priority Earth Overhaul Mod v${PRODUCT_VERSION} - Executable Installer.exe"
- InstallDir "$PROGRAMFILES\Origin Games\Mass Effect 3"
- InstallDirRegKey HKLM "Software\BioWare\Mass Effect 3" "Install Dir"
- ShowInstDetails show
- Section "-ALOT Check" SEC00
- ; Check if ALOT is installed
- SetOutPath "$INSTDIR\Binaries"
- File "ALOTDetector.exe"
- nsExec::ExecToLog '"$INSTDIR\Binaries\ALOTDetector.exe" 3 "$INSTDIR"'
- Pop $0 #return code
- var /GLOBAL AlotReturnCode
- StrCpy $AlotReturnCode $0
- Delete '"$INSTDIR\Binaries\ALOTDetector.exe"'
- ${If} $AlotReturnCode == -1
- DetailPrint "ALOTDetector.exe return code -1: Wrong number of arguments to program"
- # This should abort as it means this is definitely the wrong usage
- ${EndIf}
- ${If} $AlotReturnCode == -2
- DetailPrint "ALOTDetector.exe return code -2: Specified path not found. Ensure you've selected the game directory"
- # This should abort as it means the passed parameter is wrong,
- # thoug installer will create directory before the exe is run so it might not actually matter.
- # It means game path specified is not found so it's not actually installing into the game directory
- ${EndIf}
- ${If} $AlotReturnCode == -3
- DetailPrint "ALOTDetector.exe return code -3: Invalid game number"
- # This should abort as it means this is definitely the wrong usage
- ${EndIf}
- ${If} $AlotReturnCode == -4
- DetailPrint "ALOTDetector.exe return code -4: Marker file not found! Is this game properly installed?"
- # Should abort? This file missing means marker could not be found.
- # Will appear if game is
- ${EndIf}
- ${If} $AlotReturnCode == 0
- DetailPrint "ALOTDetector.exe return code 0: ALOT not detected"
- ${EndIf}
- ${If} $AlotReturnCode == 1
- DetailPrint "ALOTDetector.exe return code 1: ALOT detected!"
- DetailPrint "Textures detected as previously installed"
- DetailPrint "Textures MUST be installed after content mods"
- StrCpy $1 "Textures have previously been installed into this installation (through Mass Effect Modder or ALOT Installer). Installing this mod after installing textures is not supported and will break your game. ALOTDetector return code: "
- StrCpy $2 $0
- MessageBox MB_OK $1$2
- ${EndIf}
- ${If} $AlotReturnCode != 0
- StrCpy $1 "Installation aborted due to ALOTDetector.exe return code "
- DetailPrint $1$0
- abort
- ${EndIf}
- SectionEnd
- Section "PEOM Stage ${PRODUCT_VERSION} Core" SEC01
- SectionIn RO
- SetOutPath "$INSTDIR\"
- SetOverwrite on
- ; Deletes any old version of PEOM, then creates PEOM folder and installs all files up until the end of the conduit run
- RMDir /r "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\"
- RMDir /r "$INSTDIR\BIOGame\DLC\DLC_MOD_EGM_PEOM"
- RMDir /r "$INSTDIR\BIOGame\DLC\DLC_MOD_PEOM_BO_Patch"
- CreateDirectory "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\"
- CreateDirectory "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\CookedPCConsole"
- CreateDirectory "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\Movies"
- ;Copy DLC_CON_PEOM
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM"
- File /r /x desktop.ini /x thumbs.db "PEOM\DLC_CON_PEOM\"
- ; Make sure these are ASI versions
- SetOutPath "$INSTDIR\Binaries\Win32"
- File "Binkw32\binkw23.dll"
- File "Binkw32\binkw32.dll"
- SectionEnd
- Section /o "Atmosphere Update" SEC_ATMO
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\CookedPCConsole"
- File /x desktop.ini /x thumbs.db "PEOM\Alternates\Atmosphere\"
- SectionEnd
- Section /o "(1) Vanilla Endings Compatibility" SEC02
- ;Install all files post Conduit run
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\CookedPCConsole"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioA_End002_Space.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_100Opening.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_100Opening_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_200Tunnel.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_200Tunnel_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_300TIMConflict.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_300TIMConflict_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_400Guardian.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_400Guardian_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_500Choice.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_710MemorialRed.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_710MemorialRed_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_720MemorialBlue.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_720MemorialBlue_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_730MemorialGreen.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_730MemorialGreen_LOC_INT.pcc"
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\Movies"
- File "PEOM\Compatibility\Endings\Movies\End04_Andromeda_Teaser.bik"
- File "PEOM\Compatibility\Endings\Movies\Extended_Refusal.bik"
- SectionEnd
- Section /o "(1) Vanilla Endings/ThaneMod Compatibility" SEC03
- ;Install all files post Conduit run EXCEPT Memorial files
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\CookedPCConsole"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioA_End002_Space.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_100Opening.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_100Opening_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_200Tunnel.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_200Tunnel_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_300TIMConflict.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_300TIMConflict_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_400Guardian.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_400Guardian_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_500Choice.pcc"
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\Movies"
- File "PEOM\Compatibility\Endings\Movies\End04_Andromeda_Teaser.bik"
- File "PEOM\Compatibility\Endings\Movies\Extended_Refusal.bik"
- SectionEnd
- Section /o "(1) MEHEM Compatibility" SEC04
- ;INSTALLS ALL FILES UP TO ANDERON'S DEATH
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\CookedPCConsole"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioA_End002_Space.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_100Opening.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_100Opening_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_200Tunnel.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_200Tunnel_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_300TIMConflict.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_300TIMConflict_LOC_INT.pcc"
- SectionEnd
- Section /o "(1) JAM Compatibility" SEC05
- ;INSTALLS ALL FILES UP TO ANDERON'S DEATH
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\CookedPCConsole"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioA_End002_Space.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_100Opening.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_100Opening_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_200Tunnel.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_200Tunnel_LOC_INT.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_300TIMConflict.pcc"
- File "PEOM\Compatibility\Endings\CookedPCConsole\BioD_End002_300TIMConflict_LOC_INT.pcc"
- SectionEnd
- Section /o "(1) LIME Compatibility" SEC06
- ; INSTALLS NOTHING
- ; BUT LEAVE HERE TO MAKE USERS THINK WE WROTE SOMETHING FOR EM
- SectionEnd
- Section /o "EGM Continuity Patch" SEC07
- ;INSTALLS HACKETT SPEECH PCC + BIK
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\CookedPCConsole"
- SetOverwrite on
- File "PEOM\Compatibility\EGM\CookedPCConsole\BioD_Nor_610EndIntro.pcc"
- File "PEOM\Compatibility\EGM\CookedPCConsole\Default_DLC_CON_PEOM.bin"
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\Movies"
- SetOverwrite on
- File "PEOM\Compatibility\EGM\Movies\NorEnd_Hackett_Speech_Intro.bik"
- SectionEnd
- Section /o "Project Variety Patch" SEC08
- ;INSTALLS PV PATCH
- SetOutPath "$INSTDIR\BIOGame\DLC\DLC_CON_PEOM\CookedPCConsole"
- SetOverwrite on
- File "PEOM\Compatibility\ProjectVariety\BioD_PEOM_105_Intro.pcc"
- SectionEnd
- Section "-AutoTOC" SEC09
- ; Must be selected
- SectionIn RO
- ; AutoTOC game
- SetOutPath "$INSTDIR\Binaries"
- File "AutoTOC.exe"
- nsExec::ExecToLog '"$INSTDIR\Binaries\AutoTOC.exe" "$INSTDIR"'
- Delete '"$INSTDIR\Binaries\AutoTOC.exe"'
- SectionEnd
- ;======================================================================================================
- ; COMPONENTS CODE -- This is all the code that allows for the image-based components page to function.
- ; Unless adding more sections DO NOT TOUCH THIS.
- Function onguiinit
- InitPluginsDir
- StrCpy $0 0
- ClearErrors
- loop:
- SectionGetFlags $0 $1
- IfErrors done
- SectionGetText $0 $1
- WriteIniStr "$pluginsdir\cmpnt.ini" "S" $0 $1
- IntOp $0 $0 + 1
- goto loop
- done:
- ;=========================================================================================================================================================
- ; INSTALLER SECTION DESCRIPTIONS & IMAGES -- defines the rollover text and images that appear when the section names are moused over in the installer GUI
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC01}:txt" "Requires: Extended Cut/Leviathan DLC - Core PEOM Stage ${PRODUCT_VERSION}."
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC_ATMO}:txt" "Adds fog/smoke/god rays to London, making it far more atmospheric and immersive."
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC02}:txt" "Select if NOT using an ending mod. Incompatible with ThaneMod."
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC03}:txt" "Select if using ThaneMod and NOT using an ending mod."
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC04}:txt" "Select this if using Mass Effect Happy Ending Mod. Compatible with ThaneMod."
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC05}:txt" "Select this if using JohnP's Alternate MEHEM. Compatible with ThaneMod."
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC06}:txt" "Select this if using Less Is More Endings. Incompatible with ThaneMod"
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC07}:txt" "Install this patch if using Expanded Galaxy Mod."
- WriteIniStr "$pluginsdir\cmpnt.ini" "PData" "${SEC08}:txt" "Install this patch if using Project Variety."
- File "/oname=$pluginsdir\cmpnt_p${SEC01}.bmp" "Icons\peomcore.bmp"
- File "/oname=$pluginsdir\cmpnt_p${SEC_ATMO}.bmp" "Icons\peomatmo.bmp"
- File "/oname=$pluginsdir\cmpnt_p${SEC02}.bmp" "Icons\peomvanilla.bmp"
- File "/oname=$pluginsdir\cmpnt_p${SEC03}.bmp" "Icons\peomvanillathane.bmp"
- File "/oname=$pluginsdir\cmpnt_p${SEC04}.bmp" "Icons\peommehem.bmp"
- File "/oname=$pluginsdir\cmpnt_p${SEC05}.bmp" "Icons\peomjam.bmp"
- File "/oname=$pluginsdir\cmpnt_p${SEC06}.bmp" "Icons\peomlime.bmp"
- File "/oname=$pluginsdir\cmpnt_p${SEC07}.bmp" "Icons\peomegm.bmp"
- File "/oname=$pluginsdir\cmpnt_p${SEC08}.bmp" "Icons\peompv.bmp"
- FunctionEnd
- ;=======================================================================================================
- ; REMEMBER TO UPDATE THE TOTAL SECTION COUNT BELOW
- ; Set first IDX To first section and last secIdx to last section (the name SEC is not a count, but a name)
- !define FIRSTPLUGINSECIDX ${SEC00}
- !define /math LASTPLUGINSECIDX ${SEC09} + 1
- ;=======================================================================================================
- ; Functions
- ; Unless you are smart do not touch these
- Function ToggleSections
- StrCpy $0 0
- ClearErrors
- loop:
- SectionGetFlags $0 $1
- IfErrors done
- SectionSetText $0 ""
- IntOp $0 $0 + 1
- goto loop
- done:
- Pop $0
- Pop $2
- loopset:
- ReadIniStr $1 "$pluginsdir\cmpnt.ini" "S" $0
- SectionSetText $0 $1
- IntOp $0 $0 + 1
- IntCmp $0 $2 0 loopset
- FunctionEnd
- Function pagecbcmpnorm
- Push ${FIRSTPLUGINSECIDX}
- Push 0
- call ToggleSections
- FunctionEnd
- Function pagecbcmpplugin
- Push ${LASTPLUGINSECIDX}
- Push ${FIRSTPLUGINSECIDX}
- call ToggleSections
- FunctionEnd
- !define ID_TOP 0x3FF
- !define ID_TXT 0x3FE
- !define ID_IMG 0x3EE
- !define ID_LST 0x408
- Function pagecbcmppluginshow
- FindWindow $R0 "#32770" "" $HWNDPARENT
- GetDlgItem $2 $R0 ${ID_TOP}
- ShowWindow $2 0
- System::Call '*(i,i,i,i)i.r1'
- System::Call 'user32::GetClientRect(i $R0,ir1)'
- System::Call '*$1(i,i,i.r8,i.r7)'
- System::Free $1
- IntOp $8 $8 - 16 ;margin
- GetDlgItem $2 $R0 ${ID_LST}
- IntOp $6 $8 / 2
- System::Call 'user32::SetWindowPos(i$2,i0,i0,i0,ir6,ir7,i0x14)'
- IntOp $6 $6 + 8 ;half of margin
- GetDlgItem $2 $R0 ${ID_IMG}
- ${NSD_AddStyle} $2 ${SS_BITMAP}
- IntOp $7 $7 - 38
- System::Call 'user32::SetWindowPos(i$2,i0,ir6,i0,ir6,ir7,i0x14)'
- GetDlgItem $2 $R0 ${ID_TXT}
- IntOp $7 $7 + 8
- System::Call 'user32::SetWindowPos(i$2,i0,ir6,ir7,ir6,i 50,i0x14)'
- StrCpy $9 0 ;make sure bitmap variable is null
- StrCpy $0 ${FIRSTPLUGINSECIDX}
- call .onMouseOverSection ;force update
- FunctionEnd
- Function pagecbcmppluginleave
- ${NSD_FreeBitmap} $9
- StrCpy $9 0
- FunctionEnd
- Function .onMouseOverSection
- ReadIniStr $1 "$pluginsdir\cmpnt.ini" "PData" "$0:txt"
- FindWindow $R0 "#32770" "" $HWNDPARENT
- GetDlgItem $2 $R0 ${ID_TXT}
- SendMessage $2 ${WM_SETTEXT} 0 "STR:$1"
- GetDlgItem $2 $R0 ${ID_IMG}
- call pagecbcmppluginleave
- ${NSD_SetBitmap} $2 "$pluginsdir\cmpnt_p$0.bmp" $9
- FunctionEnd
Add Comment
Please, Sign In to add comment