Indigo Rose Software
  #1  
Old 09-28-2004
Sheritlw Sheritlw is offline
Indigo Rose Customer
 
Join Date: Sep 2004
Posts: 25
Huh? Assigning value from registry

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

Last edited by Sheritlw; 09-28-2004 at 11:44 PM.
Reply With Quote
  #2  
Old 09-29-2004
JXBURNS's Avatar
JXBURNS JXBURNS is offline
Forum Member
 
Join Date: Apr 2001
Location: Haverhill, Suffolk, UK
Posts: 333
You have gone overboard with your SubKey definition as the REGISTRY.GETVALUE command already refers to the LocalMachine entry so you are defining twice.

Should be something like:

Quote:
SubKey = SessionVar.Expand("%CompanyName%") + "\\" + SessionVar.Expand("%RegistryName%");
[Don't have SUF7 in front of me right now so above not may not be quite right syntax.]

Also your GETVALUE refers to HKLM then in your SUBKEY you refer to CurrentUser - are you sure you meant this?

Perhaps you were trying to get this:

Quote:
InstallDirectory = Registry.GetValue(HKEY_CURRENT_USER, SubKey, Value, true);
John
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using registry for bookmarking AXXESS AutoPlay Media Studio 5.0 12 11-01-2004 10:22 AM
HOWTO: Merge Registry Keys Desmond Setup Factory 6.0 Knowledge Base 0 10-17-2003 10:31 AM
Registry Features Dwayne Setup Factory 6.0 1 02-21-2003 04:30 AM
INFO: Finding Shell Folders in the Registry Support Setup Factory 6.0 Knowledge Base 0 10-10-2002 04:52 PM
HOWTO: Merge REG Files with the Registry Support Setup Factory 6.0 Knowledge Base 0 09-23-2002 03:48 PM


All times are GMT -6. The time now is 10:21 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software