|
#1
|
|||
|
|||
|
Reading Install Path From Registry
Hi.
I am trying to test Visual Patch with our current project. I have two problems... 1. It does not seem to read the install path correctly from the registry and keeps telling me the software is not installed... My Registry key is set as; HKEY_LOCAL_MACHINE\software\companyname\product Subkey is Install_Dir And I have checked the registry key and it does show the correct path to the application 2. We do not have a single file that always changes for patches, since we may update only some assets and not the executable, so, should we also add a versioning document that always changes between builds, and use that as the key ? Any help would be greatly appreciated. |
|
#2
|
|||
|
|||
|
I am still looking for help with this... I tried logging a support issue, but could not do that, as it said that there were already topics to cover this...
I am able to read the registry keys with several other patching tools... but unlike Visual Patch, they are unable to update those keys once the patch is installed... Do I have to look for another solution, especially as time is a big consideration in getting this working... |
|
#3
|
|||
|
|||
|
Quote:
The wizard gives you three options for ‘Locate Installed Version’. One of them is ‘Registry key’ which gives you a code snippet starting with -- Location method: Registry key -- Read a folder path from the Registry. Quote:
“A version can contain as many key files as you like; however, only one key file must be unique between versions.” Perform a search for “key file” in this forum and you’ll find several posts; this is one of them: http://www.indigorose.com/forums/showthread.php?t=11491 HTH |
|
#4
|
|||
|
|||
|
Thanks for the reply.
I use the registry key to locate the previous install, and the registry keys are definitely correct. I use the wizard to look at the registry key for the install path, and it returns something completely wrong, normal 1.1 and then writes this to the registry, even though I am not writing anything to the registry from that patch... Secondly, I have tried using a single file, actually called version.txt to identify the original and the new version, and this also does not work. This is the code used to locate the key... if not g_InstalledVersion then local MainKey = HKEY_LOCAL_MACHINE; local SubKey = SessionVar.Expand("Software\\Staggan_Interactive\\ Product"); local ValueName = "Install_Dir"; local FolderPath = Registry.GetValue(MainKey, SubKey, ValueName); g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", FolderPath); if g_InstalledVersion then SessionVar.Set("%AppFolder%", FolderPath); end end And the value set in the registry for Install_Dir is definitely the path for the current version of the software. The above is run as part of the startup script. Any ideas ? |
|
#5
|
|||
|
|||
|
Quote:
What is the returned value in g_InstalledVersion? Use the Debug function or add a MsgBox or use the log like this: Code:
g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", FolderPath);
if g_InstalledVersion then
VisualPatch.WriteToLogFile("*AppCtr*\t".."g_InstalledVersion has string value: "..g_InstalledVersion.."\r\n"); -- test log
SessionVar.Set("%AppFolder%", FolderPath);
else
VisualPatch.WriteToLogFile("*AppCtr*\t".."g_InstalledVersion has nil value: ".."\r\n"); -- test log
end
>> and then writes this to the registry It’s hard to believe that the app modifies the registry without a write action. Personally I have this code as an ‘On Post Patch’ action: --[[ Update Registry ]] Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\MyCompany\\MyProduct", "EXEVer", SessionVar.Expand("%TargetVersion%"), REG_SZ); Look through your code; be aware, TJ_Tigger has published a great AMS app you can use with your VP2.0 projects, too. All your project code is gathered into one single text file, you can transfer it to your favourite editor, print it, save it, search it. Don’t miss to download IR Project CodeViewer.exe. Ref: http://www.indigorose.com/forums/showpost.php?p=64613 |
|
#6
|
||||
|
||||
|
If your application doesn't have any good candidates for key files, and you don't want/need to use key files to verify which version is installed, you could modify the script to ignore them completely.
Basically, you'd set any file as a key file in each version (just to get around the key file checks at build time), and then modify the script to not use the CheckFolderVersion action at all. Instead, make it read the version directly from the registry, and go from there.
__________________
--[[ Indigo Rose Software Developer ]] |
|
#7
|
||||
|
||||
|
Hmmm... I knew that this could be done in TU but assumed that the key file checks we required in VP... this is good to know.
__________________
Yeah right. Who's the only one here who knows the illegal ninja moves from the government? ()))))))))o)))))))============================================== |
|
#8
|
|||
|
|||
|
I am able to use a key file actually.. we have added a version file for the application.
The problem still appears to be the registry key reading. I tried the script addition suggested, but no file was written out. I have tried another patching / installer and this works fine, it reads the registry and creates no problems. However, it does not have a few of the features of Visual Patch that I want... I have used the wizard to look for the previous path in the registry, so unless I am missing something major, this should all work... This is the generated script for the registry read.. -- Location method: Registry key -- Read a folder path from the Registry. if not g_InstalledVersion then local MainKey = HKEY_LOCAL_MACHINE; local SubKey = SessionVar.Expand("Software\\Staggan_Interactive\\ ProductName"); local ValueName = "Install_Dir"; local FolderPath = Registry.GetValue(MainKey, SubKey, ValueName); g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", FolderPath); if g_InstalledVersion then SessionVar.Set("%AppFolder%", FolderPath); end end ProductName is the name of our project, changed to protect the innocent. Is something missing ? Any help would be greatly appreciated |
|
#9
|
||||
|
||||
|
Quote:
Quote:
Here's a modified version of that script block that will pop up some messages to show you what's happening: Code:
-- Location method: Registry key
-- Read a folder path from the Registry.
if not g_InstalledVersion then
Dialog.Message("", "Checking Registry");
local MainKey = HKEY_LOCAL_MACHINE;
local SubKey = SessionVar.Expand("Software\\Staggan_Interactive\\ ProductName");
local ValueName = "Install_Dir";
local FolderPath = Registry.GetValue(MainKey, SubKey, ValueName);
Dialog.Message("", "Registry Key: \""..SubKey.."\\"..ValueName.."\"\r\nValue Returned: \""..FolderPath.."\"");
g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", FolderPath);
if g_InstalledVersion then
Dialog.Message("", "Installed Version Found: "..g_InstalledVersion);
SessionVar.Set("%AppFolder%", FolderPath);
end
end
Quote:
__________________
--[[ Indigo Rose Software Developer ]] |
|
#10
|
|||
|
|||
|
Thanks for the suggestions...
The space before product name is a typo... and as for the registry key it contains the path to the installation directory, this has been checked and all the keys used work for another patching tool... so the keys are fine. The patch is run from the My Patches folder, and I don't use anything for locating the current version other than the registry. So it should not be the case that it is finding a version before that part of the script... I'll try the amended script you sent and see what I get. Thanks |
|
#11
|
|||
|
|||
|
Hi..
Your amended script was very useful. It is indeed finding the correct path from the registry, but is still telling me the software was not found... I have double checked that the key file for both version is indeed different, and it is... What else can I try ? Thanks |
|
#12
|
||||
|
||||
|
What version does it report finding? (If it doesn't put up that third message box, it'll be the CheckFolderVersion that is failing. Which means there's something about the located files that doesn't match with any of the version tabs...)
__________________
--[[ Indigo Rose Software Developer ]] |
|
#13
|
|||
|
|||
|
Hi..
It doesn't give a version at all.. just says software not found... |
|
#14
|
|||
|
|||
|
Just to add.. I even changed the main executable in both versions and also made them key files... the effect is the same... still Software Not Found.
|
|
#15
|
|||
|
|||
|
To add a little more, I know the versions are identical apart from the two key files as one is a copy of the other....
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setup Factory and VS 2005 | vazir786 | Setup Factory 7.0 Discussion | 4 | 01-13-2006 09:47 PM |
| Problem reading PATH value in Windows Registry | fhernandez | Setup Factory 6.0 | 5 | 03-27-2003 01:57 PM |
| HOWTO: Limit the Number of Times an Install can be Run | Support | Setup Factory 6.0 Knowledge Base | 0 | 10-17-2002 03:58 PM |
| How do I add to my PATH statement at install? | Tnygaard | Setup Factory 6.0 | 3 | 05-27-2002 02:38 AM |
| How to extract a file path from registry key? | skids | AutoPlay Menu Studio 3.0 | 0 | 03-17-2002 11:48 AM |
All times are GMT -6. The time now is 10:30 PM.







Linear Mode

