Added EE support
This commit is contained in:
parent
0502ff9ae2
commit
b8bf6a2a2a
@ -23,10 +23,10 @@ diamond_download:
|
|||||||
Goto after_download
|
Goto after_download
|
||||||
|
|
||||||
ee_download:
|
ee_download:
|
||||||
inetc::get /CAPTION "Downloading Sinfar EE Launcher" /POPUP "Sinfarx launcher" /QUESTION "" "https://nwn.sinfar.net/files/sinfarx_ee.exe" "$INSTPATH\sinfarx.exe"
|
; inetc::get /CAPTION "Downloading Sinfar EE Launcher" /POPUP "Sinfarx launcher" /QUESTION "" "https://nwn.sinfar.net/files/sinfarx/8181/win32_8181.zip" "$EE_EXEPATH\sinfarLauncher.zip"
|
||||||
Pop $0
|
; Pop $0
|
||||||
StrCmp $0 "OK" +2
|
; StrCmp $0 "OK" +2
|
||||||
Goto download_failed
|
; Goto download_failed
|
||||||
|
|
||||||
after_download:
|
after_download:
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
!include "nsDialogs.nsh"
|
!include "nsDialogs.nsh"
|
||||||
|
|
||||||
Var InstallTypeRadio_NWNDIAMOND
|
Var InstallTypeRadio_NWNDIAMOND
|
||||||
;Var InstallTypeRadio_NWNEE
|
Var InstallTypeRadio_NWNEE
|
||||||
|
|
||||||
Function Page_GameSelection
|
Function Page_GameSelection
|
||||||
nsDialogs::Create 1018
|
nsDialogs::Create 1018
|
||||||
@ -13,8 +13,8 @@ Function Page_GameSelection
|
|||||||
${NSD_CreateRadioButton} 0 20u 100% 10u "Neverwinter Nights Diamond Edition"
|
${NSD_CreateRadioButton} 0 20u 100% 10u "Neverwinter Nights Diamond Edition"
|
||||||
Pop $InstallTypeRadio_NWNDIAMOND
|
Pop $InstallTypeRadio_NWNDIAMOND
|
||||||
|
|
||||||
; ${NSD_CreateRadioButton} 0 32u 100% 10u "Neverwinter Nights: Enhanced Edition"
|
${NSD_CreateRadioButton} 0 32u 100% 10u "Neverwinter Nights: Enhanced Edition"
|
||||||
; Pop $InstallTypeRadio_NWNEE
|
Pop $InstallTypeRadio_NWNEE
|
||||||
|
|
||||||
${NSD_SetState} $InstallTypeRadio_NWNDIAMOND ${BST_CHECKED}
|
${NSD_SetState} $InstallTypeRadio_NWNDIAMOND ${BST_CHECKED}
|
||||||
|
|
||||||
|
@ -2,25 +2,52 @@
|
|||||||
!include "nsDialogs.nsh"
|
!include "nsDialogs.nsh"
|
||||||
|
|
||||||
Var PathTextBoxHandle
|
Var PathTextBoxHandle
|
||||||
|
Var EEEXEPathTextBoxHandle
|
||||||
|
Var EEButtonHandle
|
||||||
|
|
||||||
Function Page_SelectNWNPath
|
Function Page_SelectNWNPath
|
||||||
|
|
||||||
StrCpy $INSTPATH "C:\Program Files (x86)\GOG Galaxy\Games\NWN Diamond"
|
|
||||||
|
|
||||||
nsDialogs::Create 1018
|
nsDialogs::Create 1018
|
||||||
Pop $0
|
Pop $0
|
||||||
|
|
||||||
|
StrCmp $INSTALL_TYPE "diamond" diamond_select_path ee_select_path
|
||||||
|
ee_select_path:
|
||||||
|
StrCpy $INSTPATH "$DOCUMENTS\Neverwinter Nights"
|
||||||
|
Goto selectpath_end
|
||||||
|
diamond_select_path:
|
||||||
|
StrCpy $INSTPATH "C:\Program Files (x86)\GOG Galaxy\Games\NWN Diamond"
|
||||||
|
Goto selectpath_end
|
||||||
|
selectpath_end:
|
||||||
|
|
||||||
|
;________________________________________
|
||||||
|
; Create label above
|
||||||
${NSD_CreateLabel} 0 0 100% 12u "Please select your Neverwinter Nights install folder:"
|
${NSD_CreateLabel} 0 0 100% 12u "Please select your Neverwinter Nights install folder:"
|
||||||
Pop $1
|
Pop $1
|
||||||
|
|
||||||
; Create a read-only text box to display the selected path
|
; Create a read-only text box to display the selected path
|
||||||
${NSD_CreateText} 0 14u 75% 12u "$INSTPATH"
|
${NSD_CreateText} 0 14u 75% 12u "$INSTPATH"
|
||||||
Pop $PathTextBoxHandle
|
Pop $PathTextBoxHandle
|
||||||
|
|
||||||
; Create a "Browse..." button
|
; Create a "Browse..." button
|
||||||
${NSD_CreateButton} 80% 14u 20% 12u "Browse..."
|
${NSD_CreateButton} 80% 14u 20% 12u "Browse..."
|
||||||
Pop $2
|
Pop $2
|
||||||
${NSD_OnClick} $2 OnBrowseClicked
|
${NSD_OnClick} $2 OnBrowseClicked
|
||||||
|
;________________________________________
|
||||||
|
|
||||||
|
StrCmp $INSTALL_TYPE "diamond" skipee_exe
|
||||||
|
StrCpy $EE_EXEPATH "C:\Program Files (x86)\GOG Galaxy\Games\Neverwinter Nights Enhanced Edition"
|
||||||
|
; Create the label
|
||||||
|
${NSD_CreateLabel} 0 32u 100% 12u "Select the location of the nwn exectable for EE:"
|
||||||
|
Pop $2
|
||||||
|
; Create the text
|
||||||
|
${NSD_CreateText} 0 44u 75% 12u "$EE_EXEPATH"
|
||||||
|
Pop $EEEXEPathTextBoxHandle
|
||||||
|
; CReate the button
|
||||||
|
${NSD_CreateButton} 80% 44u 20% 12u "Browse..."
|
||||||
|
Pop $EEButtonHandle
|
||||||
|
${NSD_OnClick} $EEButtonHandle OnBrowse2Clicked
|
||||||
|
${NSD_CreateLabel} 0 58u 100% 24u "(Path may differ for steam ex: C:\Program Files (x86)\Steam\steamapps\common\Neverwinter Nights)"
|
||||||
|
;________________________________________
|
||||||
|
|
||||||
|
skipee_exe:
|
||||||
|
|
||||||
nsDialogs::Show
|
nsDialogs::Show
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
@ -29,11 +56,22 @@ Function OnBrowseClicked
|
|||||||
nsDialogs::SelectFolderDialog "Select Neverwinter Nights Folder" "$INSTPATH"
|
nsDialogs::SelectFolderDialog "Select Neverwinter Nights Folder" "$INSTPATH"
|
||||||
Pop $0
|
Pop $0
|
||||||
StrCmp $0 "" done
|
StrCmp $0 "" done
|
||||||
|
StrCmp $0 "error" done
|
||||||
StrCpy $INSTPATH "$0"
|
StrCpy $INSTPATH "$0"
|
||||||
${NSD_SetText} $PathTextBoxHandle $INSTPATH
|
${NSD_SetText} $PathTextBoxHandle $INSTPATH
|
||||||
done:
|
done:
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
Function OnBrowse2Clicked
|
||||||
|
nsDialogs::SelectFolderDialog "Select Neverwinter Nights executable location" "$EE_EXEPATH"
|
||||||
|
Pop $0
|
||||||
|
StrCmp $0 "" done
|
||||||
|
StrCmp $0 "error" done
|
||||||
|
StrCpy $EE_EXEPATH "$0"
|
||||||
|
${NSD_SetText} $EEEXEPathTextBoxHandle $EE_EXEPATH
|
||||||
|
done:
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
Function Page_SelectNWNPath_Validation
|
Function Page_SelectNWNPath_Validation
|
||||||
; Get the current text in the folder path textbox
|
; Get the current text in the folder path textbox
|
||||||
${NSD_GetText} $PathTextBoxHandle $INSTPATH
|
${NSD_GetText} $PathTextBoxHandle $INSTPATH
|
||||||
@ -42,6 +80,10 @@ Function Page_SelectNWNPath_Validation
|
|||||||
IfFileExists "$INSTPATH\tlk\*.*" 0 invalid
|
IfFileExists "$INSTPATH\tlk\*.*" 0 invalid
|
||||||
IfFileExists "$INSTPATH\hak\*.*" 0 invalid
|
IfFileExists "$INSTPATH\hak\*.*" 0 invalid
|
||||||
|
|
||||||
|
StrCmp $INSTALL_TYPE "diamond" skipee_exe_validation
|
||||||
|
; IF EE Gotta validate for the exetucable's presence!!
|
||||||
|
IfFileExists "$EE_EXEPATH\bin\win32" 0 invalid
|
||||||
|
skipee_exe_validation:
|
||||||
; Everything is valid
|
; Everything is valid
|
||||||
Return
|
Return
|
||||||
|
|
||||||
|
@ -1,14 +1,26 @@
|
|||||||
|
|
||||||
; The stuff to install
|
; The stuff to install
|
||||||
Section "Installing" ;No components page, name is not important
|
Section "Installing haks and tlk" ;No components page, name is not important
|
||||||
SetOutPath $INSTPATH
|
SetOutPath $INSTPATH
|
||||||
DetailPrint "Extracting package..."
|
DetailPrint "Extracting custom content..."
|
||||||
|
|
||||||
Nsis7z::ExtractWithDetails "$EXEDIR\sinfar_all_files_v30.7z" "Installing package %s..."
|
;Nsis7z::ExtractWithDetails "$EXEDIR\sinfar_all_files_v30.7z" "Installing package %s..."
|
||||||
|
|
||||||
DetailPrint "Extraction complete."
|
DetailPrint "Custom content extraction complete."
|
||||||
|
|
||||||
DetailPrint "Deleting temporary files."
|
; DetailPrint "Deleting temporary files."
|
||||||
; Delete "$INSTPATH\sinfarFiles.7z"
|
; Delete "$INSTPATH\sinfarFiles.7z"
|
||||||
SectionEnd ; end the section
|
SectionEnd ; end the section
|
||||||
|
|
||||||
|
|
||||||
|
Section "Installing haks and tlk" ;No components page, name is not important
|
||||||
|
|
||||||
|
StrCmp $INSTALL_TYPE "diamond" skip_ee_extract
|
||||||
|
SetOutPath "$EE_EXEPATH\bin\win32_8181"
|
||||||
|
DetailPrint "Extracting Sinfare EE 8181..."
|
||||||
|
File "win32_8181.7z"
|
||||||
|
Nsis7z::ExtractWithDetails "win32_8181.7z" "Installing Sinfer EE v8181 %s..."
|
||||||
|
|
||||||
|
skip_ee_extract:
|
||||||
|
SectionEnd ; end the section
|
||||||
|
|
||||||
|
9
main.nsi
9
main.nsi
@ -14,6 +14,7 @@ InstallDir "$PROGRAMFILES\DummyInstall"
|
|||||||
|
|
||||||
Var INSTALL_TYPE
|
Var INSTALL_TYPE
|
||||||
Var INSTPATH
|
Var INSTPATH
|
||||||
|
Var EE_EXEPATH
|
||||||
|
|
||||||
;Pages
|
;Pages
|
||||||
!include "Pages\page_select_path.nsi"
|
!include "Pages\page_select_path.nsi"
|
||||||
@ -27,14 +28,6 @@ Page custom Page_SelectNWNPath Page_SelectNWNPath_Validation ; Custom page first
|
|||||||
Page custom Page_DownloadContent "" ; Download page
|
Page custom Page_DownloadContent "" ; Download page
|
||||||
Page InstFiles ; Then show Install progress
|
Page InstFiles ; Then show Install progress
|
||||||
|
|
||||||
Function .onInit
|
|
||||||
SetDetailsView show ; ensure log is visible
|
|
||||||
DetailPrint "==============================="
|
|
||||||
DetailPrint "Sinfar Installer v30"
|
|
||||||
DetailPrint "==============================="
|
|
||||||
DetailPrint "Initializing..."
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
Section "Create Shortcut"
|
Section "Create Shortcut"
|
||||||
DetailPrint "Creating desktop shortcut."
|
DetailPrint "Creating desktop shortcut."
|
||||||
File "UIContent\installerico.ico"
|
File "UIContent\installerico.ico"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user