[wix-users] Setting TARGETDIR for quiet install
Rob Mensching
rob at firegiant.com
Wed Mar 18 09:36:56 PDT 2020
> Or is there a different parameter i should be setting?
INSTALL_FOLDER?
History: http://robmensching.com/blog/posts/2010/1/26/stackoverflow-what-does-namesourcedir-refer-to/
Short replies here. Complete answers here: https://www.firegiant.com/services/
-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Brian E via wix-users
Sent: Wednesday, March 18, 2020 9:29 AM
To: WiX Users <wix-users at lists.wixtoolset.org>
Cc: Brian E <brianke at gmail.com>
Subject: [wix-users] Setting TARGETDIR for quiet install
I am trying to create a powershell script to do a quiet install of our product. This is the line I have in PS to run the MSI file:
msiexec /a $msiFile /passive /l*v ".\HRACtions Install Log.txt"
SERVICEACCOUNT="sa" PASSWORD="8Scripture4D34M"
CONFIRMPASSWORD="8Scripture4D34M"
This appears to run correctly and the log file indicates that the product installed correctly. The problem I am having is the product is being installed in the wrong directory. It is being installed to "C:\" when it should go to "C:\Program Files (x86)"
In the log file I see that the TARGETDIR is being set to "C:\" (PROPERTY
CHANGE: Adding TARGETDIR property. Its value is 'C:\'.)
I tried to add a parameter to the PS script to set the TARGETDIR like this:
msiexec /a $msiFile /passive /l*v ".\HRACtions Install Log.txt"
SERVICEACCOUNT="sa" PASSWORD="8Scripture4D34M"
CONFIRMPASSWORD="8Scripture4D34M" TARGETDIR="C:\Program Files (x86)"
However, now when I run the PS script, I get the Windows Installer pop-up window displaying all the msiexec options which typically indicates something is wrong with the call to msiexec.
Is there a way to set the TARGETDIR from msiexec? Or is there a different parameter i should be setting?
My Product.wxs is setting the file structure like so:
<!-- Directory setup -->
<Fragment>
<!-- Setup 'Program Files' folder for 'Delphia Consulting\HR Actions'
-->
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- 'Program Files' or Program Files (x86)' -->
<Directory Id="ProgramFilesFolder">
<Directory Id="COMPANY_DIRECTORY" Name="$(var.CompanyName)">
<Directory Id="INSTALL_FOLDER" Name="$(var.ProductName)" >
. . .
Brian
If you can't explain it simply, you don't understand it well enough. - Albert Einstein
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list