This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: kernel32.GetCurrentDirectory Not working properly after upgrade to IS 2012
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 14, 2011
03:22 PM
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?
Thanks in advance for any help you guys can provide.
Nothing was touched in my code, so I'm not sure where to go. Is there another way of getting the current directory?
string sCurrentDir; // 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.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 15, 2011
11:58 AM
I've tried also the following
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
Was this introduced in 2011?
Carry on.
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 23, 2011
12:38 PM
I don't know when that function was introduced (I suspect it was a while back). However what caused this problem was the InstallScript support for Unicode in IS 2011. Since you had your own prototype for a function using a string, you would have also needed to follow the migration steps described in KB Article Q208911 Ensuring that Your InstallScript Code Supports Unicode.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 23, 2011
12:45 PM
Thanks for the info on the migration. I will read that. (Why can't you print that webpage? What's with the frame???)
I've already removed the C++ call and started using the built in function.
I've already removed the C++ call and started using the built in function.