Added EE support
This commit is contained in:
parent
0502ff9ae2
commit
b8bf6a2a2a
@ -23,10 +23,10 @@ diamond_download:
|
||||
Goto after_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"
|
||||
Pop $0
|
||||
StrCmp $0 "OK" +2
|
||||
Goto download_failed
|
||||
; 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
|
||||
; StrCmp $0 "OK" +2
|
||||
; Goto download_failed
|
||||
|
||||
after_download:
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
!include "nsDialogs.nsh"
|
||||
|
||||
Var InstallTypeRadio_NWNDIAMOND
|
||||
;Var InstallTypeRadio_NWNEE
|
||||
Var InstallTypeRadio_NWNEE
|
||||
|
||||
Function Page_GameSelection
|
||||
nsDialogs::Create 1018
|
||||
@ -13,10 +13,10 @@ Function Page_GameSelection
|
||||
${NSD_CreateRadioButton} 0 20u 100% 10u "Neverwinter Nights Diamond Edition"
|
||||
Pop $InstallTypeRadio_NWNDIAMOND
|
||||
|
||||
; ${NSD_CreateRadioButton} 0 32u 100% 10u "Neverwinter Nights: Enhanced Edition"
|
||||
; Pop $InstallTypeRadio_NWNEE
|
||||
${NSD_CreateRadioButton} 0 32u 100% 10u "Neverwinter Nights: Enhanced Edition"
|
||||
Pop $InstallTypeRadio_NWNEE
|
||||
|
||||
${NSD_SetState} $InstallTypeRadio_NWNDIAMOND ${BST_CHECKED}
|
||||
${NSD_SetState} $InstallTypeRadio_NWNDIAMOND ${BST_CHECKED}
|
||||
|
||||
nsDialogs::Show
|
||||
FunctionEnd
|
||||
|
@ -2,26 +2,53 @@
|
||||
!include "nsDialogs.nsh"
|
||||
|
||||
Var PathTextBoxHandle
|
||||
Var EEEXEPathTextBoxHandle
|
||||
Var EEButtonHandle
|
||||
|
||||
Function Page_SelectNWNPath
|
||||
|
||||
StrCpy $INSTPATH "C:\Program Files (x86)\GOG Galaxy\Games\NWN Diamond"
|
||||
|
||||
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:"
|
||||
Pop $1
|
||||
|
||||
; Create a read-only text box to display the selected path
|
||||
${NSD_CreateText} 0 14u 75% 12u "$INSTPATH"
|
||||
Pop $PathTextBoxHandle
|
||||
|
||||
; Create a "Browse..." button
|
||||
${NSD_CreateButton} 80% 14u 20% 12u "Browse..."
|
||||
Pop $2
|
||||
${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
|
||||
FunctionEnd
|
||||
|
||||
@ -29,11 +56,22 @@ Function OnBrowseClicked
|
||||
nsDialogs::SelectFolderDialog "Select Neverwinter Nights Folder" "$INSTPATH"
|
||||
Pop $0
|
||||
StrCmp $0 "" done
|
||||
StrCmp $0 "error" done
|
||||
StrCpy $INSTPATH "$0"
|
||||
${NSD_SetText} $PathTextBoxHandle $INSTPATH
|
||||
done:
|
||||
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
|
||||
; Get the current text in the folder path textbox
|
||||
${NSD_GetText} $PathTextBoxHandle $INSTPATH
|
||||
@ -42,6 +80,10 @@ Function Page_SelectNWNPath_Validation
|
||||
IfFileExists "$INSTPATH\tlk\*.*" 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
|
||||
Return
|
||||
|
||||
|
@ -1,14 +1,26 @@
|
||||
|
||||
; 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
|
||||
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"
|
||||
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 INSTPATH
|
||||
Var EE_EXEPATH
|
||||
|
||||
;Pages
|
||||
!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 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"
|
||||
DetailPrint "Creating desktop shortcut."
|
||||
File "UIContent\installerico.ico"
|
||||
|
Loading…
x
Reference in New Issue
Block a user