Archive: nsisPatchGen problem with paths


nsisPatchGen problem with paths
Providing an absolute path as the value for the PATCH_FILES_ROOT in the patch script results in a successful build but failed patcher.

Using the default example if I were to add paths as follows:


!define PATCH_SOURCE_ROOT "C:\versions\version2"
!define PATCH_FILES_ROOT "C:\patches\patch2"


when the patch runs, during the file modification step where it creates a directory and extracts the patch file, the path to extract becomes mangled


Extract: C:\DOCUME~1\User\LOCALS~1\Temp\nsy74.tmp\C:\patches\patch2\test.txt.pat
Unable to open patch file


including the "C:\" in the middle causing this step to fail.

In addition, if I were to change the PATCH_FILES_ROOT to include "../../../" in it, I run the risk of extracting patch files outside of the temp folder.

Otherwise very nice utility.

I don't know if the author hangs here a lot, so I'd try reporting the issue in the bug tracker as well:

http://sourceforge.net/tracker/?atid...32&func=browse


Agreed. Just thought I would warn the NSIS community in general who might use it because it is a helpful utility.


Originally posted by kichik
[B]I don't know if the author hangs here a lot...
I just pop in now and again ;-)

Had a quick look at the problem. It seems the VPatchFile macro does not like absoulte paths. I think the best way to deal with this would be to improve the VPatchFile macro rather than implement our own. I could apply fixes to the VPatchFile macro regarding handling of spaces in the name suggested in the wiki page (http://nsis.sourceforge.net/VPatch_plug-in)at the same time.
I'll see what I can do....

Updated nsisPatchGen to v1.0.2 which fixes the problems with absolute paths and paths with spaces in them.

We no longer use the VPatchFile macro, instead we use our own modified version of it.