Senser
28th June 2006 21:13 UTC
How to get Current Working Directory
Hi,
I was wondering how to get the current working directory from within a NSIS installer.
I know about the GetExePath function and $EXEDir variable, but they only refer to the location of the NSIS installer. If the NSIS installer is not in the current working directory this won't work.
Anyone?
Comperio
29th June 2006 01:26 UTC
$OUTDIR should be what you're looking for.
Senser
29th June 2006 06:22 UTC
Originally posted by Comperio
$OUTDIR should be what you're looking for.
Not exactly. What I need is a way to determine from which directory the installer is started. For example: the installer myinstaller.exe is located in c:\temp.
Someone startes myinstaller.exe from d:\data by typing c:\temp\myinstaller.exe. What I need is a var that contains 'd:\data'. $OUTDIR contains c:\temp, $EXEDir contains c:\temp and GetExePath also contains c:\temp.
Maybe a call to the function GetCurrentDirectoryA from kernel32 will work, but I cannot seem to figure out how to set this up..
Instructor
29th June 2006 08:36 UTC
Name "Output"
OutFile "Output.exe"
Section
System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)"
MessageBox MB_OK "$0"
SectionEnd
Senser
29th June 2006 09:34 UTC
Originally posted by Instructor
Name "Output"
OutFile "Output.exe"
Section
System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)"
MessageBox MB_OK "$0"
SectionEnd
That's it! Thanks! :)