
mweintraub1.5524904527902551E12 asked a question.
kernel32.GetCurrentDirectory Not working properly after upgrade to IS 2012
I was using IS 2010 and upgraded to IS 2012 recently. The function, kernel32.GetCurrentDirectory was working properly before, but now it's only returning "C" (as in the drive letter?). Tested on WinXP and about to test on other O/Ses.
Nothing was touched in my code, so I'm not sure where to go. Is there another way of getting the current directory?
stringsCurrentDir;// Current Dir of install/update exe
prototype void getCurrentDir();
// Prototype to get directory setup is running from
prototype kernel32.GetCurrentDirectory (NUMBER, BYREF STRING);
function void getCurrentDir()
begin
GetCurrentDirectory(512, sCurrentDir);
end;
Thanks in advance for any help you guys can provide.
C++ functions
GetModuleFileName(null, sCurrentDir, _MAX_PATH); - Same Result
InstallShield
SRCDIR - It's the location of the extracted single exe
___________________________________________________
Found it!
When I shortened "GetCurrentDirectory" to "GetCurrentDir" in my Google search it brought up the following IS 2011 InstallScript Language Reference page:
http://helpnet.acresso.com/robo/projects/installshield17langref/langrefgetcurrentdir.htm
GetCurrentDir( svCurrentDir );
Was this introduced in 2011?
Carry on.
I've already removed the C++ call and started using the built in function.