Archive: Unable to locate file dpinst.exe


Unable to locate file dpinst.exe
Hi,
I have been trying the following piece of code on a Windows 7 x64 machine for some time and it just doesn't work.
The Notepad.exe can be located but not dpinst.exe although it is very much present in the directory.


!include "LogicLib.nsh"
Name "Example1"
OutFile "example1.exe"
InstallDir $DESKTOP\Example1

# Added by me
RequestExecutionLevel highest

Page directory
Page instfiles

Var /GLOBAL fname

Section ""
SetOutPath $INSTDIR

MessageBox MB_OK "SYSDIR: $SYSDIR"

;StrCpy $fname "$SYSDIR\notepad.exe"
StrCpy $fname "$SYSDIR\dpinst.exe"

${If} ${FileExists} $fname
MessageBox MB_OK "1"
${Else}
SearchPath $0 dpinst.exe
${If} ${FileExists} $0
MessageBox MB_OK "2"
${Else}
MessageBox MB_OK "3"
${EndIf}
${EndIf}
SectionEnd ; end the section


I could also make do with just "IfFileExists" ... that doesn't work either! :( :(

Any help would be appreciated, thanks!

Regards,
Shantanu

You need to turn off file system redirection (see Include\x64.nsh).

Stu


Aaah ... so that's what all the "redirection" was all about I had read in the search hits. OK ... I shall try it as soon as I can get to the x64 machine!

Thanks and Regards,
Shantanu


If you only plan on targeting Vista+, you can also access $WINDIR\SysNative\ to get at the 64bit location.