Sheritlw
09-28-2004, 11:42 PM
I created a custom session variable named %InstallDirectory%, and assigned a default path to this variable (%ProgramFilesFolder%\%ProductName%).
Then in the Start Up action, I try/want to check and see if the value already exists in the registry and then if it does, assign it to the Session Variable.
After several failed attempts, I thought I would see if anyone can tell me what I am doing wrong.
SubKey = ".HKEY_CURRENT_USER\\Software\\" .. SessionVar.Expand("%CompanyName%") .. "\\" .. SessionVar.Expand("%RegistryName%");
Value = "UserFileInstall";
InstallDirectory = Registry.GetValue(HKEY_LOCAL_MACHINE, SubKey, Value, true);
if "InstallDirectory" ~= "" then
SessionVar.Set("%InstallDirectory%", InstallDirectory)
result = Dialog.Message("Notice", SessionVar.Expand("%InstallDirectory%"), MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
Then in the Start Up action, I try/want to check and see if the value already exists in the registry and then if it does, assign it to the Session Variable.
After several failed attempts, I thought I would see if anyone can tell me what I am doing wrong.
SubKey = ".HKEY_CURRENT_USER\\Software\\" .. SessionVar.Expand("%CompanyName%") .. "\\" .. SessionVar.Expand("%RegistryName%");
Value = "UserFileInstall";
InstallDirectory = Registry.GetValue(HKEY_LOCAL_MACHINE, SubKey, Value, true);
if "InstallDirectory" ~= "" then
SessionVar.Set("%InstallDirectory%", InstallDirectory)
result = Dialog.Message("Notice", SessionVar.Expand("%InstallDirectory%"), MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end