Indigo Rose Software
  #1  
Old 09-07-2007
tigran tigran is offline
Forum Member
 
Join Date: Apr 2007
Posts: 56
Grin VisualPatch.CheckFolderVersion fails

Hi.

I can't make my patch work because VisualPatch.CheckFolderVersion fails on me.
The patch contains two versions (1.0 & 1.1) is was built by using a wizard.

I checked and rechecked the following:

- version 1.0 and its key file already installed on machine
- the registry key / value specified in patch to located installed version actually exist on target machine and point correctly to installed version executable (key file)
- compared MD5 values of key file for 1.0 in patch to MD5 of already installed version of executable to make sure they are the same

I still can't make it work because VisualPatch.CheckFolderVersion returns nil!

I even tried to supply hard coded application path to the function, to no avail.

The application is installed in C:\Program Files\MyCompany\MyProduct
I'm using the latest version of Visual Patch 3.0

Please help!
Reply With Quote
  #2  
Old 09-07-2007
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
Can you post your script so we can see exactly what it does?

Does the patch succeed if you copy it into the application folder and run it from there?
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #3  
Old 09-07-2007
tigran tigran is offline
Forum Member
 
Join Date: Apr 2007
Posts: 56
Below is the code for locating the application using registry/current folder.
The code correctly retrieves accurate path from registry and current folder; however, VisualPatch.CheckFolderVersion() fails in both places.

I copied the patch in the AppFolder and manually ran it.
Here is the script excerpt from OnStartup:

--------------------------------------------------------------
-- Locate installed version
--------------------------------------------------------------

-- Define a global variable that will indicate the name
-- of the installed version on the user's system. A nil value
-- indicates that an installed version has not been found.
g_InstalledVersion = nil;

-- Location method: Current folder
-- Check whether the software is installed in the folder
-- that the patch was run from.
if not g_InstalledVersion then
g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", _SourceFolder);
if g_InstalledVersion then
SessionVar.Set("%AppFolder%", _SourceFolder);
end
end

-- 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\\MyCompany\\MyApp");
local ValueName = "Program Directory";
local FolderPath = Registry.GetValue(MainKey, SubKey, ValueName);
g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", FolderPath);
if g_InstalledVersion then
SessionVar.Set("%AppFolder%", FolderPath);
end
end

--------------------------------------------------------------
-- Ensure that installed software is not running
--------------------------------------------------------------

-- If we located an out-of-date version, make sure the installed
-- software is not running.
if g_InstalledVersion then
local Filename = SessionVar.Expand("MyApp.exe");
local ProgramName = SessionVar.Expand("MyApp");
-- (g_EnsureProgramIsClosed is defined in _Global_Functions.lua)
local ProgramIsClosed = g_EnsureProgramIsClosed(Filename, ProgramName);
if not ProgramIsClosed then
Application.Exit(EXIT_REASON_PROGRAM_IS_OPEN);
end
end
Reply With Quote
  #4  
Old 09-07-2007
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
What are the source and destination paths set to in the design environment for your key files in version 1.0 and 1.1?
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #5  
Old 09-07-2007
tigran tigran is offline
Forum Member
 
Join Date: Apr 2007
Posts: 56
Cool

Lorne,

your question pointed me to the right direction which allowed me to fix the problem. When I specified the 1.1 version using a Wizard, it mirrored my source location and inserted a destination location as %AppFolder%\subfolder\MyApp.exe

This forced the patch to look for MyApp.exe in the subfolder instead of %AppFolder%

I changed the destination path of MyApp.exe to %AppFolder% and everything worked fine!

Thanks!
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
register dll fails on win98 mackscynox Setup Factory 6.0 1 04-11-2006 02:57 PM
Update fails after downloading the TS3 file. DaveCR TrueUpdate 2.0 1 11-07-2005 08:42 AM
User was able to detect that there's an update, but fails to download from the HTTP Elleah TrueUpdate 2.0 8 06-15-2005 01:15 PM
Why TU2 fails to connect, when server can be accessed via IE? Elleah TrueUpdate 2.0 10 06-15-2005 08:31 AM
Bug? - Language file fails to load with Windows 98 rball AutoPlay Media Studio 4.0 1 05-13-2003 05:58 AM


All times are GMT -6. The time now is 08:26 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