PDA

View Full Version : CheckFolderVersion



jdrescher
09-03-2007, 08:45 AM
Hello!!

We have the following problem: We build a patch with VP3 which doesn´t work, because the function CheckFolderVersion(...) always returns 0. If we load the project with VP2, everything works.
Then we created a new project and the same problem appeared.
Here is a part of our code we use:


if not g_InstalledVersion then
local MainKey = HKEY_LOCAL_MACHINE;
local SubKey = SessionVar.Expand("Software\\Test");
local ValueName = "HomeDirectory";
local FolderPath = Registry.GetValue(MainKey, SubKey, ValueName);

FolderPath = String.Concat(FolderPath, "\\bin");

g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", FolderPath);
if g_InstalledVersion then
SessionVar.Set("%AppFolder%", FolderPath);
end
end


Has this function (CheckFolderVersion) changed from VP2 to VP3 and how does it exactly work internal?

Lorne
09-04-2007, 09:37 AM
Has this function (CheckFolderVersion) changed from VP2 to VP3 and how does it exactly work internal?It now supports key files in subfolders automatically.

Try removing this line:

FolderPath = String.Concat(FolderPath, "\\bin");

You might also want to add some Debug.Print() or Dialog.Message() calls in there to see what those variables contain at run time.