Skip to content
⌘ NSIS Forum Archive

adding computer name in the MUI_FINISHPAGE_RUN_PARAMETERS

3 posts

winman2004#

adding computer name in the MUI_FINISHPAGE_RUN_PARAMETERS

i want to include computer name in the MUI_FINISHPAGE_RUN_PARAMETERS. I did the following,but it didn't work.(Below is only a part of the code).so please help me to do it.

!define getpcname computername
!define MUI_FINISHPAGE_RUN "$INSTDIR\Your ComputerName.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS "nvt${compname}"

Function computername
ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName"
StrCmp $0 "" win9x
StrCpy $1 $0 4 3
MessageBox MB_OK "Your ComputerName : $0"
StrCpy $compname $0
Goto done
win9x:
ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ComputerName" "ComputerName"
StrCpy $1 $0 4 3
MessageBox MB_OK "Your ComputerName : $0"
StrCpy $compname $0
done:
FunctionEnd
MSG#
!define MUI_FINISHPAGE_RUN_PARAMETERS "nvt${compname}"
should probably be
!define MUI_FINISHPAGE_RUN_PARAMETERS "nvt$compname"

Also, you don't seem to be using your getpcname define.
Anders#
...and you should call Kernel32::GetComputerName with the system plugin, not read undocumented registry values.