-
PATH variable changes not available until AFTER install completes
Hi all,
I need to register some DLLs in my setup (with REGSVR32), and I need to set a path on a specific folder to be able to register.
I have used the ENVIRONMENT entry in POWER EDITOR to set the path but even though, registering my Dlls caused a setup error.
It seems that's the path is not recognized at the moment a execute the script for register.
Do anyone have a solution to this problem
Thanks
-
If the COM files are your own you can rewrite them to use the registry instead of the environment variables.
-
You also might try something like this. I believe that I got this solution from another thread, but I can't remember where...
anyway:
prototype KERNEL32.SetEnvironmentVariable(BYVAL STRING, BYVAL STRING);
prototype NUMBER AddPathImmediate( STRING );
function NUMBER AddPathImmediate( szDir )
STRING svPath;
begin
// Get the current value of the PATH variable, from the copy.
GetEnvVar("PATH", svPath);
SprintfBox( INFORMATION, "DEBUG in AddPathImmediate()", "Entering AddPathImmediate()\n\nPath is now [%s]", svPath );
// Append the string you want.
svPath = svPath+";"+szDir;
// Set the PATH variable in the copy.
SetEnvironmentVariable("PATH", svPath);
// Get the current value of the PATH variable, from the copy.
GetEnvVar("PATH", svPath);
SprintfBox( INFORMATION, "DEBUG in AddPathImmediate()", "Exiting AddPathImmediate()\n\nPath is now [%s]", svPath );
end;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules