PDA

View Full Version : Problems finding my application to patch :(


wayneh
06-25-2008, 11:41 AM
I'm trying to setup VP so that my clients can manually locate the folder where my app is installed.

Unfortunately, VP rarely finds the exe file, even though it exists in the folder.
So now, my clients can never use my patches, even though it works fine on my system.

This is quite aggravating as I am putting a lot of effort into this, and Indigo Rose is basically ignoring my requests for Support - too busy working on other products.

Here's my code on a Select Folder screen.
After the user browses for the folder where my app is installed, this code runs:


local SelectedFolder = SessionVar.Expand("%SelectedFolder%");
if Filename then
Debug.Print("Filename"..Filename.."\n");
end
if SelectedFolder then
Debug.Print("SelectedFolder"..SelectedFolder.."\n");
end
if AppFolder then
Debug.Print("AppFolder"..AppFolder.."\n");
end

g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", SelectedFolder);

if g_InstalledVersion then
Debug.Print("Installed version"..g_InstalledVersion.."\n");
end

--Debug.Print(VisualPatch.GetTargetVersion());
Debug.ShowWindow(true);
if g_InstalledVersion then
SessionVar.Set("%AppFolder%", SelectedFolder);
local ProgramIsClosed = g_EnsureProgramIsClosed(Filename, ProgramName);
if not ProgramIsClosed then
Application.Exit(EXIT_REASON_PROGRAM_IS_OPEN);
end
SessionVar.Set("%InstalledVersion%", g_InstalledVersion);
SessionVar.Set("%TargetVersion%", VisualPatch.GetTargetVersion());
local LogMsg = SessionVar.Expand("Success\tLocated installed version %InstalledVersion%: %AppFolder%\r\n");
VisualPatch.WriteToLogFile(LogMsg);
if g_InstalledVersion == VisualPatch.GetTargetVersion() then
-- The target version was found
Screen.Jump("Software is Current");
else
-- An out-of-date version was found
Screen.Jump("Ready to Patch");
end
else
local mymsg="The folder does not contain a valid version of "..ProgramName..". \n Please try again."
--local mymsg="The folder does not contain a valid version of "..SessionVar.Expand("%ProductName%")..". \n Please try again."
result = Dialog.Message("Notice", mymsg, MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end


Any help is appreciated....

Lorne
06-25-2008, 04:35 PM
The CheckFolderVersion action checks the locations and MD5 signatures of all the files in a version, in order to identify and validate the version. If it isn't finding your version on some systems, it could indicate any number of things, including file corruption, bad RAM, insufficient user permissions, etc. Or it could be that you made a mistake somewhere in your modifications to the detection script.

Generally, though, when CheckFolderVersion works on the developer's system but not on the user's, it's either because the developer put the wrong files in the source folders for one of their versions, or the user doesn't have the right files installed.

Check the MD5 values of the files on your system with fsum, and check the MD5 values of the corresponding files on the user's systems with fsum. The MD5 values for the corresponding files must match in order for a version to be considered valid.

What values do those Debug.Print statements report on the systems where this problem occurs?

It could even be as simple as the user choosing the wrong directory. Make sure you find out the MD5 values of the key files in the actual folder they're selecting when they apply the patch. They might have your files in more than one place. Only the place they're patching matters.