|
|
#1 | |
|
Junior Member
Join Date: Aug 2004
Posts: 9
|
Error when Extracting NSIS-Compressed Files
I am trying to use NSIS to distribute a mod that I made. Everything compiles properly, but whenever I test the installer, I get the following error from the installer that was made by NSIS v2.0.
Quote:
The error persists whether the original files are present in the installation directory or not, so it is not an overwriting issue. Any ideas that may help? |
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Apr 2004
Posts: 130
|
Make sure that if the file already exists it isn't in use or read-only. If that isn't it make sure you have enough free disk space. That's the only time I've run into that error message but I guess there could be other reasons.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2004
Posts: 9
|
The file is neither in use, nor is it Read Only.
I've got more than 25GB available on my hard drive, so it is not a problem with that. I am not having problems extracting files that are in the root directory, only those that were in a folder during compression. Do all the files need to be in the same location prior to compiling the install script to get things to work correctly? |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Aug 2003
Posts: 26
|
(A side note... I doubt compression's your problem.)
I don't know if this matters, but it's possible you're not creating the folders before you fill them with files. Maybe it would help to use CreateDirectory? Is the path given by the error prompt accurate? I know I was confused the first time I tried the command "File Sounds\Ding.wav" and it ended up $OUTDIR instead of $OUTDIR\Sounds. Again, check if the folder exists. Hope that helps.... Geoff |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Apr 2004
Posts: 130
|
All the files don't need to be in the same location prior to compiling the script. You'll be specifying a path in your File command where the file is coming from. Do something like what KrYpT said and use CreateDiretory or use SetOutPath like it is below to make sure the folder exists and to set the path it should go to. If that doesn't work put some message boxes in to show you what your $OUTDIR and/or $INSTDIR variable are before doing your copy.
SetOutPath "$INSTDIR\help" File F:\companies\help\*.htm SetOutPath "$INSTDIR\help\images" File F:\companies\help\images\*.gif |
|
|
|
|
|
#6 | |||
|
Junior Member
Join Date: Aug 2004
Posts: 9
|
Quote:
Quote:
Quote:
|
|||
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Apr 2004
Posts: 130
|
It worked fine for me. I don't have that game installed so that key doesn't exist in my registry. I changed it to something else though and created a bunch of empty files to match your file names and it was fine. You said the error message is returning the correct path or is it just saying "\Kitanya\something.cre". In this case here it doesn't have an $INSTDIR set.
|
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Apr 2004
Posts: 130
|
It looks like your InstallDirRegKey is wrong. It's not pointing to anything under BG2Main.exe. It should be something more like:
InstallDirRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\BG2Main.exe" Path I'm guessing on the "Path" part since I don't have the game but I have several other apps installed that use a similar deal in the registry. Try: MessageBox MB_OK $INSTDIR before your first SetOutPath. |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2004
Posts: 9
|
That worked. It is extracting everything correctly now.
However, I'm getting a problem with that "ExecWait" in the .onInstSuccess call-back function. Namely, the executable won't work. I get a "bad filename" or somesuch error, despite the fact that the file is both named identically to the one in the script and it is contained in the script to be compressed into the archive. |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Apr 2004
Posts: 130
|
I put a dummy EXE file in place of setup-kitanya.exe and it executed just fine for me. It ran as soon as I clicked Close on the final install dialog. Does the real setup-kitanya.exe reguire some command line parameters or something. I'm guessing that maybe you changed some other stuff in your script after you posted one here and it caused a problem. If so put your script back up here as an attachment and I'll check it out again.
|
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Aug 2004
Posts: 9
|
setup-kitanya.exe does not require command line parameters.
I can't see exactly what the error given is, as my computer opens and closes the DOS window too quickly. |
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Apr 2004
Posts: 130
|
Ok, so the script is basically the same as it was before. I was thinking maybe you added some new stuff that might have altered the $INSTDIR before the ExecWait command. Both scripts work fine for me with fake files and a dummy EXE that just pops up a dialog. So, my next question is what is the path that you are installing into? I can use that to try and recreate exactly what your doing. Also, You said a DOS box pops up so what type of app is this that is getting launched (MFC app, console program, another installer)?
|
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Aug 2003
Posts: 26
|
I don't know if this is the problem or not, but maybe you could try "SetOutPath $INSTDIR" before the ExecWait? That just sets the current directory (so that the setup program is more likely to find associated files).
|
|
|
|
|
|
#14 | |||
|
Junior Member
Join Date: Aug 2004
Posts: 9
|
Quote:
Quote:
Quote:
|
|||
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
"When executing an application that is a 32-bit GUI application, CMD.EXE does not wait for the application to terminate before returning to the command prompt. This new behavior does NOT occur if executing within a command script."
You need to create a small C app that monitors the thread of the process you are running. If you don't know C, then do the following: 1. Get the Windows Platform SDK. The C# compiler comes with it. 2. Compile the source found in this thread. then call the new executable using your app as the -f parameter, as specified in the syntax I posted in the above thread. |
|
|
|
|
|
#16 |
|
Junior Member
Join Date: Aug 2003
Posts: 26
|
If it's really a console app you shouldn't need zimsms' code. Try using nsExec::ExecToLog and see what it comes up with.
Also, I think you can get around the problem zimsms was having by creating a batch file which simply runs your exe. Haven't tested this but you should get the idea: code: |
|
|
|
|
|
#17 |
|
Junior Member
Join Date: Aug 2004
Posts: 9
|
Actually, trying to run it via a batch file was one of the first things that I tried. I got the same result.
I'll try using ExecToLog and see if that tells me exactly what the error is. |
|
|
|
|
|
#18 |
|
Senior Member
Join Date: Apr 2004
Posts: 130
|
What were the results of using SetOutPath $INSTDIR to modify the $OUTDIR that KrYpT suggested? I'm assuming that after you do your install you are able to run the setup-kitanya.exe from the installed directory and it works fine. So, I'm thinking that should be all you need.
|
|
|
|
|
|
#19 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
As my previous post stated if the executable you are attempting to run was actually compiled as a 32-bit GUI app, then there are only the two ways around it. a) Using the ExecWait function I created, or b) Use thw Windows Scripting Wizard to create a script equivelant to the batch file you want to use.
|
|
|
|
|
|
#20 | |
|
Junior Member
Join Date: Aug 2004
Posts: 9
|
Quote:
Thanks for the help, guys. |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|