0

I'm trying to build an NSIS installer and package it with necessary drivers (MSI files from the vendor). Eventually, I'd like to install these drivers silently in the backgroud. However, I cannot seem to get it working properly.

In my NSIS script, I have the following:

ExecWait 'msiexec /i "$INSTDIR\Flash.msi INSTALLDIR="$INSTDIR\Drivers\Flash""'

It seems to execute; if I remove the INSTALLDIR switch from the above snippet, it'll run the driver installation as expected. But when I leave it in, I'm instead greeted by the following window

enter image description here

However, running the following directly in Powershell does exactly what I want, sets the install directory appropriately, as expected:

.\Flash.msi INSTALLDIR=".\Drivers\Flash\"

I'm guessing it's a silly quotation-mark mismatch somewhere, but I've tried so many already and I get the same results.

audiFanatic
  • 2,296
  • 8
  • 40
  • 56
  • [I guess you have seen this](http://nsis.sourceforge.net/Embedding_other_installers)? Just slightly different from your current command. – Stein Åsmul Jul 20 '18 at 18:46
  • @SteinÅsmul Yeah, I saw it. Where's the "slightly" different part? It seems very different to me, but nowhere do I see a way to pass in the installation directory like I'm trying to do. – audiFanatic Jul 20 '18 at 19:27

2 Answers2

2

Your doublequote for the .msi path is closed too late.

Use

ExecWait 'msiexec /i "$INSTDIR\Flash.msi" INSTALLDIR="$INSTDIR\Drivers\Flash"'
Anders
  • 97,548
  • 12
  • 110
  • 164
0

Have you tried the following:

ExecWait 'msiexec /i "$INSTDIR\Flash.msi INSTALLDIR=$\"$INSTDIR\Drivers\Flash$\""'

or

ExecWait 'msiexec /i "$INSTDIR\Flash.msi INSTALLDIR=$\"$\"$INSTDIR\Drivers\Flash$\"$\""'

Reference: http://nsis.sourceforge.net/Docs/Chapter4.html and take a look at the Strings section under 4.1 Script File Format.

Updated with extra escaped quotes.

KennZAney1
  • 91
  • 1
  • 10