3DTrains
11-22-2007, 09:49 AM
Changing from SUF 5 to v7 (trial), I'm having a tough time getting my head around the use of variables in locating an existing path on a user's sytem. The following is what I've tried thus far (in the Actions > On Startup box):
RegVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "EXE Path", true);
if RegVar ~= "" then
SessionVar.Set("%AppFolder%", RegVar);
end
and...
RegVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "EXE Path", true);
result = Application.GetLastError();
SessionVar.Set("%AppFolder%", RegVar);
RegVar = SessionVar.Expand("%AppFolder%");
Session Variables:
Folder Defaults
%RegVar% (entered in the right-side pane on the %AppFolder% line)
When I run the resulting setup, the first code example returns "%RegVar%" into the path dialog, instead of the path taken from the registry. The second code example returns an empty field for the directory to be installed to. This was all fairly straight forward in SUF v5 and it worked fine, but I'm a bit lost in SUF v7.
RegVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "EXE Path", true);
if RegVar ~= "" then
SessionVar.Set("%AppFolder%", RegVar);
end
and...
RegVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "EXE Path", true);
result = Application.GetLastError();
SessionVar.Set("%AppFolder%", RegVar);
RegVar = SessionVar.Expand("%AppFolder%");
Session Variables:
Folder Defaults
%RegVar% (entered in the right-side pane on the %AppFolder% line)
When I run the resulting setup, the first code example returns "%RegVar%" into the path dialog, instead of the path taken from the registry. The second code example returns an empty field for the directory to be installed to. This was all fairly straight forward in SUF v5 and it worked fine, but I'm a bit lost in SUF v7.