!defineMUI_WELCOMEPAGE_TEXT"The PRC will now be installed into your installation of Neverwinter Nights.\r\n\r\n\r\nNeverwinter Nights version $NWNVERSION is currently installed at $NWNPATH."
; Get the parent directory of the $NWNPATH to use for the PRC, since
; the NWN install path always has the nwn\ folder which contains the game,
; we want the PRC installer EXE and readme's to be parallel to that.
Push$NWNPATH
CallGetParent
Pop$NWNPRCPATH
; Make sure that 1.1 or later of the .NET framework is installed.
CallIsDotNETInstalled
Pop$0
StrCmp$01foundNETFrameworknoNETFramework
foundNETFramework:
Return
noNETFramework:
MessageBoxMB_OK|MB_ICONEXCLAMATION"The .NET Framework 1.1 is not installed on your PC. The PRC cannot be installed until the .NET Framwwork 1.1 is installed. Use Windows Update to install the .NET Framework 1.1 or later, or download it from the following web page."
MessageBoxMB_OK|MB_ICONEXCLAMATION"The PRC requires at least version 1.66 of NWN and HotU. You must upgrade NWN before installing the PRC."
Abort
noXP:
MessageBoxMB_OK|MB_ICONEXCLAMATION"The PRC requires Shadows of Undrentide and Hordes of the Underdark to be installed. You must upgrade NWN before installing the PRC. If you installed the expansions by copying the files directly and did not install them using Bioware's setup applications, then you must reinstall using Bioware's setup applications."
Abort
noNWN:
MessageBoxMB_OK|MB_ICONEXCLAMATION"Neverwinter Nights is not installed on your PC. The PRC cannot be installed until Neverwinter Nights is installed."
Abort
FunctionEnd
; GetParent
; input, top of stack (e.g. C:\Program Files\Poop)
; output, top of stack (replaces, with e.g. C:\Program Files)
; modifies no other variables.
;
; Usage:
; Push "C:\Program Files\Directory\Whatever"
; Call GetParent
; Pop $R0
; ; at this point $R0 will equal "C:\Program Files\Directory"
FunctionGetParent
Exch$R0
Push$R1
Push$R2
Push$R3
StrCpy$R10
StrLen$R2$R0
loop:
IntOp$R1$R1+1
IntCmp$R1$R2get0get
StrCpy$R3$R01-$R1
StrCmp$R3"\"get
Gotoloop
get:
StrCpy$R0$R0-$R1
Pop$R3
Pop$R2
Pop$R1
Exch$R0
FunctionEnd
; IsDotNETInstalled
;
; Usage:
; Call IsDotNETInstalled
; Pop $0
; StrCmp $0 1 found.NETFramework no.NETFramework
FunctionIsDotNETInstalled
Push$0
Push$1
Push$2
Push$3
Push$4
ReadRegStr$4HKEY_LOCAL_MACHINE\
"Software\Microsoft\.NETFramework""InstallRoot"
# remove trailing back slash
Push$4
Exch$EXEDIR
Exch$EXEDIR
Pop$4
# if the root directory doesn't exist .NET is not installed