Old 8th August 2006, 08:56   #1
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
Internal compiler error while compiling a script

Hello,
I have a problem compiling a script.
When I've started the process it compresses the files but after 3 hours the following error appears:


Perhaps somebody knows a solution.

Phiffi
Phiffi is offline   Reply With Quote
Old 8th August 2006, 09:11   #2
Truth Unknown
Junior Member
 
Join Date: Aug 2006
Posts: 19
I'm also gettig this error, I've tried replacing the file it stops on.

code:
Internal compiler error #12345: error mmapping file (1967843348, 33554432) is out of range.

Note: you may have one or two (large) stale temporary file(s)
left in your temporary directory (Generally this only happens on Windows 9x).



I'm using version 2.19 of NSIS.

EDIT: Should have searched first even when this topic was on the first page. Seems NSIS cant use more than 2.0 GB of data.
Truth Unknown is offline   Reply With Quote
Old 8th August 2006, 13:08   #3
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
Oh no. Not more than 2GB? But I have to compile 12GB!
Do you know what to do in this case?
Phiffi is offline   Reply With Quote
Old 8th August 2006, 13:36   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You'll have to include it outside the installer in a compressed file and use ZipDLL to uncompress the file or 7za.exe from www.7-zip.org if you wish to use 7z (LZMA).

-Stu
Afrow UK is offline   Reply With Quote
Old 8th August 2006, 13:54   #5
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
All right, I downloaded the 7z program but what do I have to do now? The script is ready. Do I have to add something to this?
Phiffi is offline   Reply With Quote
Old 8th August 2006, 14:00   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You need to add code to extract the 7za.exe executable at run time to $PLUGINSDIR and then run it from there with nsExec::ExecToLog on your 7z file(s).

-Stu
Afrow UK is offline   Reply With Quote
Old 9th August 2006, 12:28   #7
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
Could you please tell me which code I have to use and where to add this?
Perhaps a step-by-step description for noobs.
My knowledge isn't very big in scripting.
Thanks!

Last edited by Phiffi; 9th August 2006 at 12:57.
Phiffi is offline   Reply With Quote
Old 9th August 2006, 13:02   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use File to extract 7za.exe to $PLUGINSDIR.
Use nsExec::ExecToLog to execute 7za.exe under a Section with the correct parameters to extract the files from the 7z file.

-Stu
Afrow UK is offline   Reply With Quote
Old 9th August 2006, 16:59   #9
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
Well, the only exe-Files I have are 7z.exe; 7zFM.exe and 7zG.exe.
And where do I have to use "File"? Do you mean the "File" in MakeNSISW?
I don't know which program to use for this operation.
Phiffi is offline   Reply With Quote
Old 9th August 2006, 17:01   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
7za.exe is the standalone command-line version of 7-Zip, which you can download from the website.

You have written some NSIS code haven't you?
I mean File as in the NSIS instruction?
Look at the NSIS manual!

-Stu
Afrow UK is offline   Reply With Quote
Old 9th August 2006, 17:53   #11
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
I found the file command:
File /oname=$PLUGINSDIR\7za.exe 7za.exe
Is this correct?
But I don't know which parameters I have to use for the plugin.
nsExec::ExecToLog '"${NSISDIR}\7za.exe" /CMDHELP'
Phiffi is offline   Reply With Quote
Old 10th August 2006, 04:54   #12
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
Once you extract the file using the file command, then you launch it with nsEXEC. The purpose of nsEXEC is to run a command-line program, but redirect its output so that you don't see the ugly command window appear.

My suggestion would be to experiment with 7za to determine the proper parameters you'll need. Once you've determined that, then run the same command using nsEXEC. The command should look something like this:
code:

nsExec::ExecToLog /OEM '"$PLUGINSDIR\7za.exe" [-options]'


The [-options] part is the command line options you need. (If you are having problems with this, you should consult your 7-zip help manual or try browsing the 7-zip SourceForge Project Site) Just don't forget to include any paths in quotes (as shown above and for any folder paths you might need to include as parameters.)

Also, it would be extremely helpful for you too to take the time to lean NSIS a bit better. There's plenty of documentation in the NSIS help (as Afrow suggests) plus more examples/documentation in the NSIS directories. Plus, you can also use the search option of this forum.
Comperio is offline   Reply With Quote
Old 10th August 2006, 09:20   #13
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
I searched the 7z help and found the command to extract an archive.
nsExec::ExecToLog /OEM '"$PLUGINSDIR\7za.exe" [-e]'
But how do I proceed.
In the script I created multiple sections to be later able to choice what to install but now I have to use 7z archives instead of the files is that right?

My script looks like that:
Section "Half-Life 2 (erforderlich)" SEC01
SetOutPath "$INSTDIR\bin"
SetOverwrite try
File "NEUER ORDNER\bin\AdminServer.dll"
File "NEUER ORDNER\bin\bsppack.dll"

I have to pack all files in one archive and add this in the script, right?:
Section "Half-Life 2 (erforderlich)" SEC01
SetOutPath "$INSTDIR\bin"
SetOverwrite try
File /oname=$PLUGINSDIR\7za.exe
nsExec::ExecToLog /OEM '"$PLUGINSDIR\7za.exe" [7za <a> [<-m{LZMA}>] <Half-Life2.7z> [<file_names>...]'

I used -m{LZMA} for compression method LZMA and the parameter <a> to add files to an archive. But I don't know if I can add a complete directory on <file_names>
Phiffi is offline   Reply With Quote
Old 10th August 2006, 09:39   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You don't actually put < or > in there!
Open up the 7-Zip manual in the Start menu and it has complete details about the command line version (mine does anyway).

Why are you adding files to the archive? You're meant to be extracting them! I think you've got the wrong end of the stick. You compress your files into a 7z file with 7-Zip, include that file with your installer and extract it at run time to $INSTDIR with 7za. Remember, this code is executed at run time when the user runs the installer, not when you compile the installer.

The -m switch does not set the type of compression. -t does that. You don't actually need -t though, because 7za will detect the archive type for you.

code:
nsExec::ExecToLog /OEM '"$PLUGINSDIR\7za.exe" x "$EXEDIR\Half-Life2.7z" -o"$INSTDIR"'


-Stu
Afrow UK is offline   Reply With Quote
Old 10th August 2006, 11:12   #15
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
Ok, I think I get it now.
I have to compile the archive with these commands:

Section "Half-Life 2 (erforderlich)" SEC01
SetOutPath "$INSTDIR"
SetOverwrite try
File "7za.exe"
File "Half-Life2.7z"
nsExec::ExecToLog /OEM '"$PLUGINSDIR\7za.exe" x "$EXEDIR\Half-Life2.7z" -o"$INSTDIR"'

Quote:
Remember, this code is executed at run time when the user runs the installer, not when you compile the installer.
Means this line "nsExec::ExecToLog..." mustn't stand in the script?

Thank you for your patience describing these things to me.
Phiffi is offline   Reply With Quote
Old 10th August 2006, 11:59   #16
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can't have
File "Half-Life2.7z"
in there, because you said it's 12GB. NSIS installers can't be over 2GB.

No, it doesn't. nsExec::ExecToLog is a run time instruction. Compile time instructions begin with a !
My point was that your code would create the 7z archive at run time, when you want to extract from it.

-Stu
Afrow UK is offline   Reply With Quote
Old 10th August 2006, 12:26   #17
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
The files in Half-Life2.7z are just a part of the whole installation and their size is 3.1 GB uncomprimized. Therefore I have to comprimize it with 7zip that the file is smaller than 2 GB. But does it matter that the whole installation-exe would be bigger than 2 GB or one file mustn't be bigger than 2 GB?

How can I add the run time instruction to the script?
Phiffi is offline   Reply With Quote
Old 10th August 2006, 12:54   #18
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Anything within Sections or Functions are executed at run time.
The NSIS installer executable can't be over 2GB. I'm not sure if the files that can be compressed into the installer need to be under 2GB as well.

-Stu
Afrow UK is offline   Reply With Quote
Old 10th August 2006, 13:10   #19
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
That means I can't add any files into the exe because it would become too big but I can add the install-exe and the 7z files in one folder and tell the install-exe to unpack the 7z files into the install directory with this commands:

Section "Half-Life 2 (erforderlich)" SEC01
SetOutPath "$INSTDIR"
SetOverwrite try
File "7za.exe"
nsExec::ExecToLog /OEM '"$PLUGINSDIR\7za.exe" x "$EXEDIR\Half-Life2.7z" -o"$INSTDIR"'

But is it okay if I just add the 7za.exe to the install-exe. I mean the users of this installer doesn't have 7za.exe or NSIS.
Perhaps I just change the path of 7za.exe into:

nsExec::ExecToLog /OEM '"$INSTDIR\7za.exe" x "$EXEDIR\Half-Life2.7z" -o"$INSTDIR"'
Phiffi is offline   Reply With Quote
Old 10th August 2006, 13:15   #20
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It'd be better to just extract 7za.exe to $PLUGINSDIR because $PLUGINSDIR is deleted when the installer is closed. Plus, 7za.exe is 300+ KB so you might as well compress it. Make sure you have "SetCompressor /solid lzma" in your script.

By the way, $PLUGINSDIR isn't the NSIS\Plugins folder! It's a temporary folder created at run time in $TEMP.

-Stu
Afrow UK is offline   Reply With Quote
Old 10th August 2006, 13:28   #21
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
The right decision would be:

SetOutPath "$PLUGINSDIR"
SetOverwrite try
File "7za.exe"
nsExec::ExecToLog /OEM '"$PLUGINSDIR\7za.exe" x "$EXEDIR\Half-Life2.7z" -o"$INSTDIR"'

Okay?

Another problem: How can I add icons to my shortcuts?

CreateShortCut "$SMPROGRAMS\Half-Life 2.lnk" "$INSTDIR\Half-Life 2.bat"
CreateShortCut "$DESKTOP\Half-Life 2.lnk" "$INSTDIR\Half-Life 2.bat"
Phiffi is offline   Reply With Quote
Old 10th August 2006, 13:30   #22
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Yes.
Just make sure you put InitPluginsDir before SetOutPath just in case $PLUGINSDIR has not yet been created.

-Stu
Afrow UK is offline   Reply With Quote
Old 10th August 2006, 13:31   #23
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
See CreateShortcut in the manual.

-Stu
Afrow UK is offline   Reply With Quote
Old 14th August 2006, 01:02   #24
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
Like this:

CreateShortCut "$SMPROGRAMS\Half-Life 2.lnk" "$INSTDIR\Half-Life 2.bat" "" "$INSTDIR\youricon.ico"
CreateShortCut "$DESKTOP\Half-Life 2.lnk" "$INSTDIR\Half-Life 2.bat" "" "$INSTDIR\yourprog.exe"

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 14th August 2006, 11:17   #25
Phiffi
Junior Member
 
Join Date: Aug 2006
Location: Germany Hannover
Posts: 12
Thank you all for your great help.
The installer-exe runs perfectly and the icons for the shortcuts too!
Phiffi 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