sinfar-installer/main.nsi
2025-04-20 15:30:51 -04:00

56 lines
1.5 KiB
NSIS

;!include "MUI2.nsh"
!include "nsDialogs.nsh"
!include "LogicLib.nsh"
Outfile "SinfarInstaller-v30.exe" ; Name of the output file
RequestExecutionLevel admin ; We need admin right just to be sure everything work smoothly, use can refuse anyway.
Icon "UIContent\installerico.ico" ; Sinfar icon!!!
InstallDir "$PROGRAMFILES\DummyInstall"
Var INSTALL_TYPE
Var INSTPATH
;Pages
!include "Pages\page_select_path.nsi"
!include "Pages\page_download_files.nsi"
!include "Pages\page_game_selection.nsi"
;Sections
!include "Sections\section_extract_files.nsi"
Page custom Page_GameSelection Page_GameSelection_Validation ; Game selection, ee vs diamond
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"
; Path to the target file
StrCpy $0 "$INSTPATH\sinfarx.exe"
; Path to the desktop shortcut
StrCpy $1 "$DESKTOP\Sinfar.lnk"
; Create the shortcut
CreateShortcut "$1" "$0" "$INSTDIR\installerico.ico"
SectionEnd
Section "Done"
DetailPrint "Installation done, launch game from the desktop shortcut to start playing."
SectionEnd