Archive: NSIS Issue on Chinese windows XP / 7


NSIS Issue on Chinese windows XP / 7
I have a simple silent installer script which installs a printer driver and then run a EXE. It works perfectly in English OS, but in both the Chinese Traditional and Simplified it will fail to find the folder where the files have been extracted, which is the user Temp folder.
Here is the script. Please let me know what solution is available.

# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"

# Included files
!include Sections.nsh
!include "FileFunc.nsh"
!include LogicLib.nsh


#!insertmacro GetParameters

# Installer pages
Page instfiles

# Installer attributes
OutFile DriverX86.exe
CRCCheck on
XPStyle on
Icon "logo.ico"
SilentInstall silent
Var DEVICE_NAME
# Installer sections
Section -Main SEC0000
StrCpy $DEVICE_NAME "XXXX Device"
SetOutPath $TEMP\UPD
SetOverwrite on
File /a /r Print\Win_2KXP\*
ExecWait "rundll32 printui.dll PrintUIEntry /if /b $\"$DEVICE_NAME$\" /f $TEMP\UPD\somefile.inf /m $\"XXXX Device$\" /r $\"LPT1:$\""
Delete $TEMP\UPD\Win_2KXP\English\i386\*
Delete $TEMP\UPD\Win_2KXP\English\*
Delete $TEMP\UPD\Win_2KXP\i386\*
Delete $TEMP\UPD\Win_2KXP\*
RMDir /r $TEMP\UPD\i386
RMDir /r $TEMP\UPD\English\i386
RMDir /r $TEMP\UPD\English
RMDir /r $TEMP\UPD
SetOutPath $TEMP\BPTracker
SetOverwrite on
File /a /r WIN-DS3IVPKX4GX_Install\*
ExecWait "$TEMP\BPTracker\WIN-DS3IVPKX4GX_Install.exe /s"
Delete $TEMP\BPTracker\WIN-DS3IVPKX4GX_Install.exe
RMDir $TEMP\BPTracker
SectionEnd

# Installer functions
Function .onInit
InitPluginsDir
FunctionEnd


The problem seems to be in the $TEMP variable. When the installer is executed the system is unable to find the Driver files which is located in $TEMP\UPD

You are missing some quotes, try ExecWait "rundll32 printui.dll PrintUIEntry /if /b $\"$DEVICE_NAME$\" /f $\"$TEMP\UPD\somefile.inf$\" /m $\"XXXX Device$\" /r $\"LPT1:$\""

and ExecWait '"$TEMP\BPTracker\WIN-DS3IVPKX4GX_Install.exe" /s'