Old 22nd January 2014, 12:58   #1
********
Junior Member
 
Join Date: May 2004
Posts: 43
Thumbs down Eliminating $_OUTDIR

I unpack binary Wesnoth installers (~300Mb) to build binary updates (~30Mb).
Unfortunately, unpacking means installing, because the dir structure inside
NSIS archive is mangled by the presence on $_OUTDIR directory.

code:

SetOutPath "$INSTDIR\manual"
File /r /x .* doc\manual\*.html
File /r /x .* doc\manual\styles
File /r /x .* doc\manual\images



This will create the following structure:

code:

manual
manual.cs.html
manual.de.html
manual.en.html
...
manual.zh_TW.html

$_OUTDIR
styles
manual.css
images
README.txt
game-screen-1.9.4.jpg
recruit-1.9.4.jpg
...
de
game-screen-1.9.14.jpg
...



Why there is $_OUTDIR prefix in one case and no prefix in another?
Is it possible to eliminate $_OUTDIR?
******** is offline   Reply With Quote
Old 22nd January 2014, 15:11   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,914
NSIS was never designed to be unpacked but it is open source so somebody made an unpacker (which is great) so you really need to ask the author of the unpacker or just make a batch file to correct it after unpacking...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 22nd January 2014, 15:34   #3
********
Junior Member
 
Join Date: May 2004
Posts: 43
The problem here (as it seems) that some paths in NSIS script are recorded as absolute to install dir and others as relative to some run-time variable, so in the latter case unpacking requires scripts interpretation.

If NSIS could make both records static (which seems pretty feasible), it will make installer format a little bit more friendly for open source users.
******** is offline   Reply With Quote
Old 23rd January 2014, 17:02   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
There is no reason the unpacker cannot prepend $OUTDIR to the relative paths. This kind of information is not required for the install process and would just add additional overhead.

Stu
Afrow UK is offline   Reply With Quote
Old 29th January 2014, 09:36   #5
********
Junior Member
 
Join Date: May 2004
Posts: 43
Unpacker actually prepends $_OUTDIR to the relative paths, but for some reason it can not calculate the actual path, which is relative to the installation dir. Unpacker is 7-Zip.

http://www.7-zip.org/download.html

There is a source code on this page. I tried to read it, but my C skill is too low to find out where the problem is and where it can be fixed, so that I could correctly unpack Wesnoth installer with properly restored dir structure relative to INSTDIR.
******** is offline   Reply With Quote
Old 29th January 2014, 10:43   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
$OUTDIR is set with SetOutPath, or it can be set directly (e.g. with StrCpy). Therefore it's not really possible for the unpacker to know what its value will be - it will only be known when actually running the installer.

Stu
Afrow UK is offline   Reply With Quote
Old 29th January 2014, 11:40   #7
********
Junior Member
 
Join Date: May 2004
Posts: 43
I thought about this too, but then how these *.html files are end up being in correct manual/ subdirectory and not in $_OUTDIR after unpacking?

SetOutPath "$INSTDIR\manual"
File /r /x .* doc\manual\*.html
******** is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump