Archive: Problem with a Simple LabVIEW Installer using the Nullsoft Install System (NSIS)


Problem with a Simple LabVIEW Installer using the Nullsoft Install System (NSIS)
Hello there,

My first posting to this group and my first use of using NSIS in earnest.

I'm trying to build a simple multiple part installer. I've been through the very through example of merging various installers here:

http://nsis.sourceforge.net/Embedding_other_installers

The particular installer (setup.exe) I'm having trouble with is built using National Instruments LabVIEW 8.2.1. Their installer is based on MSI. I created my LabVIEW executable, created their MSI wrapper installer and tried to call it with the simple wizard installer created using HM NIS Editor 2.0.3. I'm using NSIS 2.34

When I run my three part NSIS installer, the first two parts install correctly but the LabVIEW MSI installer bugs out when it trys to run the "setup.exe". The dialog prompts with the following:

"Fatal Error. Unable to find initialization file.

.\ConfigInfo.cpp(2642): IInstallerError 11005
Fatal Error. Unable to find initialization file.
File C:\Program Files\My application\setup.ini not found."

It seems to be pointing to a setup.ini in the destination directory, I don't reference this in my NSIS installer. In my LabVIEW MSI installer, the setup.exe is paired with two files nidist.id and setup.ini. The nidist.id contains the DistributionGUID and DistPackageGUID. The setup.ini is National Instruments MSI configuration and it makes a requiremetn to have WindowsInstaller-KB893803-v2-x86.exe version 3.0.0.0 installed.

Here's a snippet of my .nsi script file:

Section "My NSIS test application" SEC03
File "setup.exe"
ExecWait "$INSTDIR\setup.exe"
; ExecWait '"msiexec" /i "$INSTDIR\setup.exe" /passive'
; ExecWait "$INSTDIR\setup.exe /s /v"/qb"
SectionEnd

I've tried changing the ExecWait command to see if this makes the difference (see commented out lines) but to no avail. Which one should I be using for MSI's?

Can anyway point me in the right direction here?

Many thanks,
Chroma


The link seems to have been ommitted:

nsis.sourceforge.net/Embedding_other_installers


Maybe you could figure out where it looks for setup.ini using FileMon and put it there.


Note sure I understand. I am very familiar with FileMon. When the installer runs it creates a temp dir in my Local settings dir, with the following files:

modern-wizard.bmp
ioSpecial.ini
InstallOptions.dll

It then yields the error as I mentioned previously,

".\ConfigInfo.cpp(2642): IInstallerError 11005
Fatal Error. Unable to find initialization file.
File C:\Program Files\Metrosol\setup.ini not found."

These temp files are then removed.

The other two installers that I kick off before this installer do not have setup.ini files associated with them. These installers work fine and I based the NSIS installer on the NSIS example link I sighted earlier.

If I place the third installers setup.ini file in the required destination folder (C:\Program Files\xxx), it yields the following error

".\ConfigInfo.cpp(2653): IInstallerError 11006
Developer Error. The following errors were found in your ini file:
1. Specified file not found: [MsiEngine] WinNTPath = supportfiles\WindowsInstaller-KB893803-v2-x86.exe

Correct the ini file and try again.
<No Debug Message>"

I seem to be no further forward.

Questions:

1) Am I missing something with regard to how I am calling ExecWait in the NSIS install script?
2) Where is the original error coming from? Is is NSIS or the National Instruments NSI installer?
3) Are there any tools I can use to log the NSIS installer as it fires?

Any help greatly appreciated.

Many thanks,
Chroma


The problem here is not with ExecWait, it's with the executed installer. All of these errors are generated by it. It seems like it's missing some files, like setup.ini and a folder called supportfiles. I made that comment about FileMon because I've assumed you've extracted those files in the wrong folder and the installer couldn't find them.


I have the following folders in my NSIS installer executable directory:

\MyInstall.exe - my NSIS, named changed to protect innocent!
\nidist.id - NI Distribution and DistPackage GUIDs config file
\setup.exe - the NI SETUP I'm trying to execute
\setup.ini - NI file
\supportfiles - NI misc files (dir)
\license - NI Released License Agreement (dir)
\bin - National Instruments Installer packages (dir)
\installers - my other installers (dir)


But according to the error, they're looked for in $INSTDIR and not $EXEDIR. Put them there instead.


I'm not sure I understand. Isn't the installer supposed to dynamically create the output EXE directory? Are you asking me to create this in advance of running the main NSIS installer?

Perhaps I'm getting the wrong end of the stick here, but which files do you suggest I move around? Please note that I used the NSIS example link, as my template and none of the other installer in that example have a setup.ini

-Chroma


OK, then we'll start from the beginning. Those errors you are getting have nothing to do with your NSIS installer. You're getting them because the installer your installer is executing can't find some files.

You said all the required files are located right besides your installer, which is $EXEDIR. But you execute the other installer from $INSTDIR.

Assuming both the other installer and the files it's looking for should be in one place, you only have two options. Either execute the other installer from $EXEDIR or move the files to $INSTDIR.


I greatly appreciate your patience on this issue!

Here's currently what I have:

Section "installer1" SEC01
File "installers\installer1.exe"
ExecWait "$INSTDIR\installer1.exe"
SectionEnd
;------------------------------------------------------------------------------------------------------
Section "installer2" SEC02
File "installers\installer2.exe"
ExecWait "$INSTDIR\installer2.exe"
SectionEnd
;------------------------------------------------------------------------------------------------------
Section "My NI LabVIEW App Installer" SEC03
File "setup.exe"
ExecWait "$INSTDIR\setup.exe"


You're suggesting I change the above script to this:

Section "installer1" SEC01
File "installers\installer1.exe"
ExecWait "$INSTDIR\installer1.exe"
SectionEnd
;------------------------------------------------------------------------------------------------------
Section "installer2" SEC02
File "installers\installer2.exe"
ExecWait "$INSTDIR\installer2.exe"
SectionEnd
;------------------------------------------------------------------------------------------------------
Section "My NI LabVIEW App Installer" SEC03
File "setup.exe"
ExecWait "$EXEDIR\setup.exe"

Is this correct?

-Chroma


No, that would not be enough. Executing the installer from $EXEDIR won't work if you still extract it to $INSTDIR. Setting the working directory to $EXEDIR might work though... SetOutPath also sets the working directory. So try extracting the installer to $INSTDIR, setting the working directory to $EXEDIR and executing the installer from $INSTDIR. If that doesn't work, extract the installer to $EXEDIR or just don't compress it.


I tried the changes you suggested (changing the line ExecWait "$INSTDIR\setup.exe" to ExecWait "$EXEDIR\setup.exe", as shown). This seems to work. For the record, my SetOutPath is "$INSTDIR".


Could you illustrate the two scenarios you suggested in terms of the NSIS script I currently use? I don't won't to make any mistakes, having come so far on this one! Apologies for being a burden here!

-Chroma


I'm not sure I understand what you're asking me to explain and how. The two scenarios I've described are related to the way the other installer (not a NSIS installer) deals with the files it needs.


Yes, I understand what you are saying regarding the other installer (the non-NSIS installer). What I was looking for was the two scenarios explained in terms of the script snippet I described.

Section "installer1" SEC01
File "installers\installer1.exe"
ExecWait "$INSTDIR\installer1.exe"
SectionEnd
;------------------------------------------------------------------------------------------------------
Section "installer2" SEC02
File "installers\installer2.exe"
ExecWait "$INSTDIR\installer2.exe"
SectionEnd
;------------------------------------------------------------------------------------------------------
Section "My NI LabVIEW App Installer" SEC03
File "setup.exe"
ExecWait "$EXEDIR\setup.exe"

This seems to work for me, but is this the best practice way of doing an installer of this type (a multi-part mixed installer)?

-Chroma


Well, if you have files beside your installer which are not compressed into the installer, I assume you're using a CD distribution or something similar. In that case, it's recommended you don't compress the other installers into your installer. That would only take time compressing and decompressing something that's already compressed. This way, you can also make sure the right directory structure is kept without any scripting.

There is no one recommended way for an installer that executes other installers. It depends on the end result you're looking for and the executed installers.


I think I have enough information to continue developing my application. Thanks for all your assistance and patience, it's greatly appreciated.

-Chroma