Indigo Rose Software

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

 
 
Thread Tools Display Modes
  #1  
Old 01-17-2007
wayneh wayneh is offline
Indigo Rose Customer
 
Join Date: Jan 2007
Posts: 10
Can I force an update/replacement of a file?

I sometimes create multiple builds under the same version number, i.e. 1.0.2 may have several builds (with or without minor changes - I know I shouldn't but nevertheless...)

Currently my pacth lets users locate the desired directory, then uses this code:
Code:
g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", SelectedFolder);
if g_InstalledVersion then
	SessionVar.Set("%AppFolder%", SelectedFolder);
etc....
Am I correct in assuming that I can "force" and update by doing the following?
1) Remove the first two lines above (and eliminate the if statement accordingly)
2) Choose "force install" on the file properties for my exe file.

Will that replace the previous exe with the new one?

Is there a way to verify the exe and version, but ignore the MD5?
(That way I could be sure they are overwriting the proper version of the exe without worrying about the specific build!)


Thanks....
  #2  
Old 01-18-2007
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 wayneh View Post
I sometimes create multiple builds under the same version number, i.e. 1.0.2 may have several builds (with or without minor changes - I know I shouldn't but nevertheless...)
Yeah, sometimes it happens. I would recommend assigning an "internal" name to each version, though, just to help you keep track of things (it can be really easy to mix files up otherwise). Even just adding the date to the newer one, or a letter like "a" and "b."
Quote:
Currently my pacth lets users locate the desired directory, then uses this code:
Code:
g_InstalledVersion = VisualPatch.CheckFolderVersion("%AppFolder%", SelectedFolder);
if g_InstalledVersion then
	SessionVar.Set("%AppFolder%", SelectedFolder);
etc....
That SessionVar.Set is redundant...CheckFolderVersion already assigns the path to %AppFolder% for you if the version is found (that's why you pass it %AppFolder% in fact ...you could use some session variable other name if you wanted).

Quote:
Am I correct in assuming that I can "force" and update by doing the following?
1) Remove the first two lines above (and eliminate the if statement accordingly)
2) Choose "force install" on the file properties for my exe file.

Will that replace the previous exe with the new one?
You don't need to use force install. You can build a patch between two files if they're different -- they don't need to have different version numbers. You just need to differentiate based on a file that is different internally.

Quote:
Is there a way to verify the exe and version, but ignore the MD5?
(That way I could be sure they are overwriting the proper version of the exe without worrying about the specific build!)
I'm not sure why you'd want to ignore the MD5. Generally speaking, if the MD5 of two files are the same, the files are the same. Files that are exactly the same don't need patching.

If your exe file hasn't changed, all you really need to do is add another key file, or select a different one, so Visual Patch can tell the difference between those two versions.
__________________
--[[ Indigo Rose Software Developer ]]
  #3  
Old 01-18-2007
wayneh wayneh is offline
Indigo Rose Customer
 
Join Date: Jan 2007
Posts: 10
Lorne -

I don't think you understood my issue about my files.

When using "VisualPatch.CheckFolderVersion", if the file on the client machine
(v1.0.0) is not identical to MY copy of v1.0.0 (which was used to create the patch), then patching does not occur.

They may have v1.0.0 (a), and I may have v1.0.0 (b), which is not indicated in the version number assigned to the actual exe.

I want to override this, but still be sure the client file is v1.0.0.

Does that explain it better?
  #4  
Old 01-18-2007
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 wayneh View Post
When using "VisualPatch.CheckFolderVersion", if the file on the client machine
(v1.0.0) is not identical to MY copy of v1.0.0 (which was used to create the patch), then patching does not occur.
That's correct, if VP2 doesn't know anything about the file on the client machine. Differential binary patching requires an exact match for the source file (the one to be patched) or it will fail.

You can enable "force install" to achieve this, although without differential binary patching the size of the patch file will most likely increase.

However, if you define a version that matches the one on the client machine, it will be able to patch it fine.
Quote:
They may have v1.0.0 (a), and I may have v1.0.0 (b), which is not indicated in the version number assigned to the actual exe.
What you need is for v1.0.0 (a) and v1.0.0 (b) to both be defined in your patch. Then you can build a patch that will go from 1.0.0 (a) or 1.0.0 (b) to your current version.

The file version of the exe can still be used, if you want. Just mark the exe as a key file and Visual Patch will be able to identify (a) from (b) based on the MD5 signature.
Quote:
I want to override this, but still be sure the client file is v1.0.0.
Yep. See above.
__________________
--[[ Indigo Rose Software Developer ]]
  #5  
Old 01-18-2007
wayneh wayneh is offline
Indigo Rose Customer
 
Join Date: Jan 2007
Posts: 10
Lorne -

I'm trying to do this without keeping a million little versions, so I doubt I'll include every single build into the patch.

That is why I basically need to do this:
1) After the user selects a folder, find the Key file (myapp.exe)
2) Get the (client) Key file version (1.0.0)
3) Compare the version to what is allowed in the patch (1.0.0, 1.0.1, etc)
4) Then force the update...

I can't use "VisualPatch.CheckFolderVersion" because it sees the difference in the builds.

What can I do?
  #6  
Old 01-18-2007
wayneh wayneh is offline
Indigo Rose Customer
 
Join Date: Jan 2007
Posts: 10
Ok, I kept digging and this is what I've come up with.

In the screen where the user selectes the app folder:

Code:
local SelectedFolder = SessionVar.Expand("%SelectedFolder%");
whfiles = File.Find(SelectedFolder, Filename, false, false, nil, nil);
if (whfiles) then
	whfilever = File.GetVersionInfo(whfiles[1]);
	if (String.CompareFileVersions(whfilever.FileVersion, "#OLDESTVERSION#")>-1) then
		if (String.CompareFileVersions(whfilever.FileVersion, "#NEWESTVERSION#")==-1) then
			g_InstalledVersion=whfilever.FileVersion;
		else
			g_InstalledVersion=nil;
		end
	end
end

if g_InstalledVersion then
	SessionVar.Set("%AppFolder%", SelectedFolder);
etc.....
Do you see any problems, particularly with the 'CompareFileVersions' statements?
  #7  
Old 01-19-2007
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 wayneh View Post
I'm trying to do this without keeping a million little versions, so I doubt I'll include every single build into the patch.
You have no choice if you want to use binary differencing. Visual Patch needs to build a difference file for every old version of the file you want to patch. That's just the way binary differencing works.

If you want to build a full-history patch without having to worry about all the different older versions, use the 'Force install' option. You can still check the exe file version if you want, but I'd personally just use a different file as a key file. (Make sure the exe is not a key file or Visual Patch will reject all installations with the b, c, d, e, etc. versions of that file.)

It might be worth noting that you don't have to build a single, full-history patch. You could do separate projects for these special cases if you wanted. Or do one full-history patch, that uses the 'Force install' option, and another "previous version to current version" patch. Do one of those every time you make a change (even if the version number doesn't change).

That becomes an even better option if you use TrueUpdate, since it can automate the process of choosing which patch to use, making it more advantageous to have many smaller patches instead of one big patch.

Depending on the size of the file in question, if you have a lot of releases the 'Force install' option is probably your best bet since for a full history patch the individual diffs will start to add up, and Visual Patch might end up using the whole file anyway. (Even if each diff is only 1% of the original file's compressed size, once you have 100 of them it makes more sense to just include the original file.)
__________________
--[[ Indigo Rose Software Developer ]]
  #8  
Old 01-19-2007
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 wayneh View Post
Do you see any problems, particularly with the 'CompareFileVersions' statements?
Nothing looks wrong at a quick glance. If you use 'Force install' and don't make the exe a key file, it should work.
__________________
--[[ Indigo Rose Software Developer ]]
  #9  
Old 01-19-2007
wayneh wayneh is offline
Indigo Rose Customer
 
Join Date: Jan 2007
Posts: 10
Are you saying not use the exe as a Key file because the built-in 'file locator methods' will not find it?

'Cause my whole solution is this:
1) Let VP look for the exe based on current folder - if not found then
2) Check Registry for key - if not found then
3) Allow User to select Folder and only look for valid versions

This way, I can keep the key file the exe and most times VP will find it ok.
Only when the unusual situation occurs (build b or c, etc) will the User locate the folder and then we'll patch based strictly on Version.

I know the patch files will be larger due to 'force install', but this way the patch is more flexible....
  #10  
Old 01-19-2007
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 wayneh View Post
Are you saying not use the exe as a Key file because the built-in 'file locator methods' will not find it?

'Cause my whole solution is this:
1) Let VP look for the exe based on current folder - if not found then
2) Check Registry for key - if not found then
3) Allow User to select Folder and only look for valid versions

This way, I can keep the key file the exe and most times VP will find it ok.
Only when the unusual situation occurs (build b or c, etc) will the User locate the folder and then we'll patch based strictly on Version.
You're right, that should work fine.
__________________
--[[ Indigo Rose Software Developer ]]
 

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
Best way to share custom buttons with the group? mwreyf1 AutoPlay Media Studio 6.0 10 09-03-2009 05:01 AM
http://yourfilelink.com - 50MB max upload, free! Intrigued General Chat 14 09-26-2006 09:44 AM
Error 3038: Could not seek in compressed file Rikard Setup Factory 7.0 Discussion 2 05-25-2006 12:55 PM
Can search allow manual browse even if file is found? RichardShaw Setup Factory 5.0 2 08-28-2000 07:08 PM
Install only into one of several directories with specific existing file? RichardShaw Setup Factory 5.0 0 08-17-2000 03:29 PM


All times are GMT -6. The time now is 04:16 AM.


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