Indigo Rose Software

Go Back   Indigo Rose Software Forums > Old Versions > Visual Patch 2.0

 
 
Thread Tools Display Modes
  #1  
Old 04-20-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
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  
Old 04-22-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
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  
Old 04-23-2006
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
Quote:
Originally Posted by Staggan
1. It does not seem to read the install path correctly from the registry and keeps telling me the software is not installed...
My experiences with VP2.0 is limited (only one single real project) but I know the LUA engine in the IR products very well. If you can’t read the install path correctly from the registry, you certainly have done some mistakes. You don’t give any details about your code and consequently it is difficult to give any advice.

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:
Originally Posted by Staggan
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 ?
From the help doc:
“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  
Old 04-23-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
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  
Old 04-24-2006
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
Quote:
Originally Posted by Staggan
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...
>> it returns something completely wrong
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
(I love to use the log feature in Setup Factory.)

>> 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  
Old 04-24-2006
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
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  
Old 04-24-2006
TJS's Avatar
TJS TJS is offline
Indigo Rose Customer
 
Join Date: Oct 2005
Location: MI
Posts: 522
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  
Old 04-25-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
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  
Old 04-25-2006
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
Quote:
Originally Posted by Staggan
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...
Visual Patch has absolutely no problems reading from the Registry...the same actions are used in TrueUpdate and Setup Factory and they have been thoroughly tested over many years of use. Reading and writing from the Registry are considered critical features in our products and even the tiniest changes undergo extensive testing.

Quote:
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.
Few things:
  • It looks like you have a space before ProductName above...is that space in your script, or was it just a typo when you edited out the real product name?
  • Does that exact registry key exist on the system you're testing on? Software\Staggan_Interactive\ProductName\Install_D ir
  • What is the value of Install_Dir in the Registry?
  • Double-check your paths and names in the script and in the Registry...because of how quickly the human brain recognizes patterns, it can actually be pretty hard to spot a typo.
  • Is g_InstalledVersion being set earlier in the script? The default script checks the current folder first, so if you're running the patch in a folder where a copy of the key file(s) exists, it might be setting g_InstalledVersion earlier and never going into this script block that looks in the Registry. Try adding a message box to determine this (see below).

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:
Any help would be greatly appreciated
It's a bit tough to determine what's wrong without seeing the rest of your script and what's in your Registry at that location. But if you use the modified script block above, it should give you some clues.
__________________
--[[ Indigo Rose Software Developer ]]
  #10  
Old 04-26-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
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  
Old 04-26-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
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  
Old 04-26-2006
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
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  
Old 04-26-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
Hi..

It doesn't give a version at all.. just says software not found...
  #14  
Old 04-26-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
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  
Old 04-26-2006
Staggan Staggan is offline
Forum Member
 
Join Date: Apr 2006
Posts: 69
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....
 

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
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.


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