Comment [WixUtilExtension]:
Wix Toolset Library and Extension DLL reference to a Wix Project. The Wix
Toolset automatically adds necessary parameters to the Compiler (candle.exe)
and Linker (light.exe) command lines, so as to correctly resolve when building
the project.
Linkage of appropriate extension DLL’s, causes the Linker to automatically pull
all relevant Custom Actions, Error Messages and binary table rows into the MSI
<!--__________________________________________________________________ -->
<!-- Add wixca.dll into the Binary table -->
<!--__________________________________________________________________ -->
<!--Note: Create a database package using SQL Packager for the sample
product "db2mobileSQLPackage" called db2mobileSQLPackage.exe
Running this silently, this can accomplished by referencing
the wixca library that comes with Wix, which provides a function
called CAQuietExec.
<!--__________________________________________________________________ -->
<!--Note: Wixca allows us to run CAQuietExec (no annoying DOS box)
$(env.WIXROOT) is available when we SET WIXROOT=<path> in DOS.
This helps to make the project portable because we can set the WIX
program directory in the build .bat file and then put these
project files wherever we want.
<!--___________________________________________________________________ -->
<BinaryId="wixca"SourceFile="c:\Program Files\Windows Installer XML
v3\bin\WixUtilExtension.dll" />
Comment [SourceFile Attribute]:
Specifies where to find the file for packaging during the build—Full Path
reference to the binary file. Instead of hard-coding these values as above we
could alternativerly use Wix pre-processor variables that are passed to the WiX
compiler.
<!--<Binary Id="wixca" SourceFile="wixca.dll" />-->
<!--<Binary Id="wixca" SourceFile="$(env.WIXROOT)\wixca.dll" />-->
[CAQuietExec-1] Could someone provide example code to use the QtExec custom
action? First of all, where is the "wixca.dll" located in WiX 3.0? It's not in
C:\Program Files\WiX Installer XML v3\bin where it was in WiX 2.0.
[CAQuietExec-2] In 3.0 they have moved the ca to the WixUtilExtension.dll so
you need to add a reference to it to be able to use WiXCA. I am assuming you
are using the VS 2005 plugin, so just right click the reference folder in you
WiX project and add a reference to the WixUtilExtension.dll in the WiX bin
folder. This should compile and work (it does for me).
<!--____________________________________________________________________ -->
<!--Note: Deferred custom actions can't access properties, so they have to
be set using a custom action. A common use of this pattern for
QtExec custom actions is to run an executable that will be
installed as a part of the Windows Installation setup
application
<!--_____________________________________________________________________ -->
<!--Note: WixQueryOsInfo, WixQueryOsDirs, and WixQueryOsDriverInfo custom
actions in wixca (part of WixUtilExtension)set properties over and
above the MSI set for OS product/suite detection and standard
directories. The WixQueryOsWellKnownSID custom action sets
properties for the localized names of some built in Windows users
and groups.
<!--_______________________________________________________________________->
<CustomActionId="Database.Install.Properties"Property="Database.Install"
Value=""[INSTALLDIR]db2mobileSQLPackage.exe"
/server:[SERVERNAME]/database:[DATABASENAME] /
quiet/makedatabase"/>
<CustomActionId="Database.Install.Properties.Sql"Property="Database.Install"
Value=""[INSTALLDIR]db2mobileSQLPackage.exe"/server:[SERVERNAME]
/database:[DATABASENAME]/username:[DBUSERNAME]
/password:[PASSWORD]/quiet/makedatabase"/>
<!--______________________________________________________________________ -->
<!--Note: QtExec custom action allows you to run an arbitrary command line
in an MSI-based setup in silent mode. QtExec is commonly used to
suppress console windows that would otherwise appear appear when
invoking the executable directly. The custom action is located in
the WixCA library, which is a part of the
WixUtilExtension
<!--_____________________________________________________________________
-->
<CustomActionId="Database.Install"Impersonate="yes"BinaryKey="wixca"
DllEntry="CAQuietExec"Execute="deferred"Return="check"/>
<!--_____________________________________________________________________ -->
<!--Our custom tasks run in the InstallExecuteSequence, the following
install and uninstall conditions included (componentname=2 means to run
only on uninstall) vs (componentname>2 means to run only on
install)
<!--_____________________________________________________________________ -->
<InstallExecuteSequence>
<CustomAction="Database.Install.Properties"
After="InstallFiles">$db2mobileSQLPackager.Packages>2
</Custom>
<CustomAction="Database.Install.Properties.Sql"
After="Database.Install.Properties">$db2mobileSQLPackager.Package
s>2 AND USEINTEGRATEDSECURITY=0
</Custom>
<CustomAction="Database.Install"
After="Database.Install.Properties.Sql">$db2mobileSQLPackager.Pac
kages>2 AND USEINTEGRATEDSECURITY=1
</Custom>
</InstallExecuteSequence>
[CAQuietExec-3] There is a documentation mistake in WiX3 chm, you need to
replace the Id="wixca" with Id="WixCA and remove the Binary element.
Then you will need to add WixUtilExtension to light using -ext switch.
[CAQuietExec-4] I need to be able to use Wix Quiet Execution Custom Action
(CAQuietExec), which is in WixCA library which is a part of the
WixUtilExtension. I thought i could do this by creating a "Call Dll" Custom
Action and add " -ext WixUtilExtension" to candle and light compile options.
Unfortunately, MSIFactory seems to insert additional reference to WixCA
(line <Binary Id="WixCA" SourceFile="WixCA"/>) into setup and that results in
error during linking
("error LGHT0091: Duplicate symbol 'Binary: WixCA’ found"), because that symbol
already defined in WixUtilExtension library.
Now, if i remove WixUtilExtension from the compiler options, i'm starting to
get a different error
("error LGHT0103 : The system cannot find the file 'WixCA'.")So the question
is, what would be a correct way to invoke CAQuietExec during setup?
Comment [Alternative Shell.Execute Custom Action]:
If you set the full path to the DLL instead of just informing "WixCA" in the
Settings dialog of your Custom Action, you will see that the installer builds
without error messages. There seems to be some problem in the way you set the
Custom Action in your dummy project, as it does not get executed. When I
changed the timing, the CA is executed, however it fails because the
$(var.MSIFactoryFolder)\Wix\WixUtilExtension.dll is not part of the files that
are deployed on the target system, so the requested DLL cannot be found. If the
idea is just the silent execution of some command or program, I would suggest
using the Luanch action Shell.Execute() instead, setting the WindowMode
parameter to "-1".
<!--<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT
Installed</Publish>-->
<!--______________________________________________________________________________
-->
<!--Note: Include the custom
action -->
<!--______________________________________________________________________________
-->
<!-- The WixShellExec custom action in wixca (part of
WixUtilExtension) -->
<!-- lets you open document or URL targets via the Windows shell. A
common -->
<!-- use is to launch readme files or URLs using their registered
default -->
<!-- applications based on their
extension. -->
<!--______________________________________________________________________________
-->
<!--<Property Id="WixShellExecTarget" Value="[#db2mobileSQLPackage.exe]" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />-->
<!--_________________________________________________________________________________
-->
<!-- Note: that WixShellExecute can only be used as an immediate custom
action -->
<!--_________________________________________________________________________________
-->
<!-- as it launches an application without waiting for it to close.
WixShellExec -->
<!-- reads its target from the WixShellExecTarget property, formats it,
and then -->
<!-- calls ShellExecute with the formatted value. It uses the default
verb, which -->
<!-- is usually
"open." -->
<!--_________________________________________________________________________________
-->
<!--<ProgressText Action="LaunchApplication">WixShellExecute EnterpriseSMS
database
"[DATABASENAME]"</ProgressText>-->
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users