- NSIS Discussion
- Internal compiler error while compiling a script
Archive: Internal compiler error while compiling a script
Phiffi
8th August 2006 09:56 UTC
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:
http://img145.imageshack.us/img145/9...iserrorod4.jpg
Perhaps somebody knows a solution.
Phiffi
Truth Unknown
8th August 2006 10:11 UTC
I'm also gettig this error, I've tried replacing the file it stops on.
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.
Phiffi
8th August 2006 14:08 UTC
Oh no. Not more than 2GB? But I have to compile 12GB!
Do you know what to do in this case?
Afrow UK
8th August 2006 14:36 UTC
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
Phiffi
8th August 2006 14:54 UTC
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?
Afrow UK
8th August 2006 15:00 UTC
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
Phiffi
9th August 2006 13:28 UTC
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!
Afrow UK
9th August 2006 14:02 UTC
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
Phiffi
9th August 2006 17:59 UTC
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? http://img456.imageshack.us/img456/6386/filedr2.jpg
I don't know which program to use for this operation.
Afrow UK
9th August 2006 18:01 UTC
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
Phiffi
9th August 2006 18:53 UTC
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'
Comperio
10th August 2006 05:54 UTC
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:
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.
Phiffi
10th August 2006 10:20 UTC
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>
Afrow UK
10th August 2006 10:39 UTC
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.
nsExec::ExecToLog /OEM '"$PLUGINSDIR\7za.exe" x "$EXEDIR\Half-Life2.7z" -o"$INSTDIR"'
-Stu
Phiffi
10th August 2006 12:12 UTC
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"'
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.
Afrow UK
10th August 2006 12:59 UTC
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
Phiffi
10th August 2006 13:26 UTC
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?
Afrow UK
10th August 2006 13:54 UTC
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
Phiffi
10th August 2006 14:10 UTC
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"'
Afrow UK
10th August 2006 14:15 UTC
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
Phiffi
10th August 2006 14:28 UTC
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"
Afrow UK
10th August 2006 14:30 UTC
Yes.
Just make sure you put InitPluginsDir before SetOutPath just in case $PLUGINSDIR has not yet been created.
-Stu
Afrow UK
10th August 2006 14:31 UTC
See CreateShortcut in the manual.
-Stu
JasonFriday13
14th August 2006 02:02 UTC
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"
Phiffi
14th August 2006 12:17 UTC
Thank you all for your great help.
The installer-exe runs perfectly and the icons for the shortcuts too!