[wix-users] COM Object exception

Alex Tuppen alex.tuppen at gmail.com
Wed Mar 29 10:40:09 PDT 2017


I am certainly planning on implementing a rollback option before this goes
anywhere near production but for now I want to make sure that I understand
everything and have it working properly. Good to know about changing it to
deferred, what do you mean be "check"?

Sorry if I was not clear before but the CA is not failing:
Action ended 13:46:43: CA_CustomAction. Return value 1.

The failure is InstallInitialize:
Action start 13:46:43: InstallInitialize.
Action ended 13:46:43: InstallInitialize. Return value 3.

Unless I have got my return values mixed up...

Alex

P.S. Awesome! Over here in the UK it is the company I work for
https://www.poweronplatforms.com/

On Wed, 29 Mar 2017 at 17:54 John Cooper <JoCooper at jackhenry.com> wrote:

> I would change from immediate to deferred and author a rollback action.
> You could put whatever custom failure logic in the rollback CA--in addition
> to undoing the config change.
>
> In any event, "check" is going to set a 1603 on CA failure which is going
> to trigger a rollback and a failure code for the MSI.
>
> CA's that modify state should not be immediate, but there are various
> reasons why that is convenient.
>
> P.S. PowerON -- that's an extension to one of my products.  :)
> --
> John Merryweather Cooper
> Senior Software Engineer -- Integration Development Group -- Enterprise
> Notification Service
> Jack Henry & Associates, Inc.® | Lenexa, KS  66214 | Office:
> 913-341-3434x431050 <(913)%20341-3434>
> JoCooper at jackhenry.com
>
>
>
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf
> Of Alex Tuppen
> Sent: Wednesday, March 29, 2017 10:55 AM
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> Subject: Re: [wix-users] COM Object exception
>
> The e-mail below is from an external source.  Please do not open
> attachments or click links from an unknown or suspicious origin.
>
> Well that makes a lot of sense and worked first time, thank you! Last
> question (hopefully) because my Google phu has failed me, I cannot find
> another example of someone using an MSI to just run a CA. My CA is now
> completing fine, but the MSI as a whole is failing, I assume that this has
> something to do with the fact that it is not actually installing anything.
> Does anyone know what I need to add into my MSI to make it report a
> successful install based on the CA result?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
> <Product Id="9CA8C1BA-4944-47EB-B0D3-14E452CC995E"
>            Name="PowerONConfiguration"
>            Language="1033"
>            Version="1.0.0.0"
>            Manufacturer="PowerON"
>            UpgradeCode="5bf0657c-e3dd-477b-a352-f7e27c4068a3">
> <Package InstallerVersion="200"
>              Compressed="yes"
>              InstallScope="perMachine" />
>
> <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is
> already installed." /> <MediaTemplate />
>
>     <Property Id="CUSTOMERID" Secure="yes" Value="No CustomerID set" />
>
>     <UIRef Id="WixUI_ErrorProgressText"/>
>
>     <Binary Id="CustomActionDLL"
>             SourceFile="$(var.CustomAction.TargetDir)CustomAction.CA.dll"
> />
>
>     <CustomAction Id="CA_CustomAction"
>                   BinaryKey="CustomActionDLL"
>                   DllEntry="ConfigureHybridWorker"
>                   Execute="immediate"
>                   Return="check" />
>
>     <InstallUISequence>
>       <Custom Action="CA_CustomAction"
>               After="CostFinalize"/>
>     </InstallUISequence>
>
>     <InstallExecuteSequence>
>       <Custom Action="CA_CustomAction"
>               After="CostFinalize"/>
>     </InstallExecuteSequence>
> </Product>
> </Wix>
>
> Alex
>
> On Wed, 29 Mar 2017 at 13:36 David Watson <dwatson at sdl.com> wrote:
>
> > Hi,
> > I think the default behaviour of an msi in a bundle is to run
> > silently, this means that the UI is not displayed and the
> > InstallUISequence is not processed.
> >
> > Your custom action is immediate and scheduled in the UI sequence so is
> > not being run - note the (c) next to the log entries that denote the
> > client sequence for the ui.  (s) for the server level from the
> > InstallExecute sequence.
> >
> > Dave
> >
> >
> > [http://dr0muzwhcp26z.cloudfront.net/static/corporate/SDL_emailLogo.pn
> > g]<
> > www.sdl.com/>
> > www.sdl.com
> >
> >
> > SDL PLC confidential, all rights reserved. If you are not the intended
> > recipient of this mail SDL requests and requires that you delete it
> > without acting upon or copying any of its contents, and we further
> > request that you advise us.
> >
> > SDL PLC is a public limited company registered in England and Wales.
> > Registered number: 02675207.
> > Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire
> > SL6 7DY, UK.
> >
> > -----Original Message-----
> > From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On
> > Behalf Of Alex Tuppen
> > Sent: 29 March 2017 10:32
> > To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> > Subject: Re: [wix-users] COM Object exception
> >
> > That is what I thought, but that is not what the logs are telling me
> > is happening. The log for the MSI if I run the bundle says this:
> >
> > Action start 9:12:21: CostInitialize.
> > MSI (s) (B4:C4) [09:12:21:049]: Doing action: FileCost Action ended
> > 9:12:21: CostInitialize. Return value 1.
> > MSI (s) (B4:C4) [09:12:21:049]: Note: 1: 2205 2:  3: MsiAssembly
> > Action start 9:12:21: FileCost.
> > MSI (s) (B4:C4) [09:12:21:049]: Doing action: CostFinalize Action
> > ended 9:12:21: FileCost. Return value 1.
> > MSI (s) (B4:C4) [09:12:21:049]: Note: 1: 2731 2: 0 Action start
> > 9:12:21: CostFinalize.
> >
> > Whereas the log if I run the MSI outside of the bundle, I get this:
> >
> > Action start 9:26:27: FileCost.
> > MSI (c) (E8:44) [09:26:27:493]: Note: 1: 2205 2:  3: MsiAssembly MSI
> > (c) (E8:44) [09:26:27:493]: Note: 1: 2205 2:  3: Registry MSI (c)
> > (E8:44) [09:26:27:493]: Note: 1: 2205 2:  3: Registry MSI (c) (E8:44)
> > [09:26:27:493]: Note: 1: 2205 2:  3: Class MSI (c) (E8:44)
> > [09:26:27:493]: Note: 1: 2205 2:  3: Extension MSI (c) (E8:44)
> > [09:26:27:493]: Note: 1: 2205 2:  3: TypeLib Action ended 9:26:27:
> > FileCost. Return value 1.
> > MSI (c) (E8:44) [09:26:27:493]: Doing action: CA_CustomAction Action
> > 9:26:27: CA_CustomAction.
> > Action start 9:26:27: CA_CustomAction.
> >
> > Does the difference between the two simply mean that verbose logging
> > is still not working? just to check that I have configured it
> > correctly the CA is being called from the MSI like this:
> >
> >    <Binary Id="CustomActionDLL"
> >
> > SourceFile="$(var.CustomAction.TargetDir)CustomAction.CA.dll" />
> >
> >    <CustomAction Id="CA_CustomAction"
> >                  BinaryKey="CustomActionDLL"
> >                  DllEntry="ConfigureHybridWorker"
> >                  Execute="immediate"
> >                  Return="check" />
> >
> >    <InstallUISequence>
> >      <Custom Action="CA_CustomAction"
> >              Before="CostFinalize"/>
> >    </InstallUISequence>
> >
> > Alex
> >
> > On Tue, 28 Mar 2017 at 16:42 Phill Hogland <phill.hogland at rimage.com>
> > wrote:
> >
> > > Not that I know of.   The CA is in the MSI.  There is no concept of a
> CA
> > > in a bundle.  The bundle processes the MsiPackage and whatever is
> > authored
> > > in the MSI is processed by msiexec.
> > >
> > > ________________________________
> > > From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf
> > > of Alex Tuppen <alex.tuppen at gmail.com>
> > > Sent: Tuesday, March 28, 2017 9:55:50 AM
> > > To: WiX Toolset Users Mailing List
> > > Subject: Re: [wix-users] COM Object exception
> > >
> > > Thank you for such a fast and comprehensive reply! Unfortunately
> > > even
> > with
> > > verbose logging enabled in the registry (and double checking that
> > > that is working by running the MSI separately) I am not seeing my CA
> > > start. Is there any reason why a CA would work fine when the MSI is
> > > run by itself
> > but
> > > not when run from inside a bundle?
> > >
> > > Alex
> > >
> > > On Tue, 28 Mar 2017 at 15:13 Phill Hogland
> > > <phill.hogland at rimage.com>
> > > wrote:
> > >
> > > There are several approaches to debug a CA.
> > >
> > > 1) Enable verbose MSI logging either in the registry or on the
> > commandline.
> > >
> > >
> > https://support.microsoft.com/en-us/help/223300/how-to-enable-windows-
> > installer-logging
> > >
> > > How to enable Windows Installer logging<
> > >
> > >
> > https://support.microsoft.com/en-us/help/223300/how-to-enable-windows-
> > installer-logging
> > > >
> > > support.microsoft.com
> > > Windows includes a registry-activated logging service to help
> > > diagnose Windows Installer issues. This article describes how to
> > > enable this
> > logging
> > > service.
> > >
> > >
> > >
> > >
> > > 2) when using Burn pass LOGVERBOSE (with anything) as a MsiProperty
> > > of
> > the
> > > MsiPackage.  Setting the machine MSI logging policy in the registry
> > > to include *v is equivalent to using LOGVERBOSE, but when LOGVERBOSE
> > > is used without the policy on the CAs get the verbose logging, which
> > > may easier
> > to
> > > work with.
> > >
> > > 3) Set the Environment variable MsiBreak = 'NameOfCustomAction'.
> > > Then
> > have
> > > your source project open and when prompted attach to the msiexec
> > > process related to your CA using the PID provided in the dialog.
> > >
> > >
> > > Here are some other approaches (note Rob's post):
> > >
> > >
> > >
> > http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-d
> > ebug-CustomAction-DLL-td5458781.html
> > >
> > >
> > >
> > > The CA should set a return code.
> > >
> > >
> > >
> > https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072(v=vs
> > .85).aspx
> > >
> > > Custom Action Return Values (Windows)<
> > >
> > >
> > https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072(v=vs
> > .85).aspx
> > > >
> > > msdn.microsoft.com
> > > If the msidbCustomActionTypeContinue return processing option is not
> > > set, the custom action must return an integer status code as shown
> > > in the following table.
> > >
> > >
> > >
> > >
> > >  There are many examples in the wix source code under the src\ext
> folder.
> > >
> > >
> > > Phill
> > >
> > > wix-users - How to debug CustomAction DLL<
> > >
> > >
> > http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-d
> > ebug-CustomAction-DLL-td5458781.html
> > > >
> > > windows-installer-xml-wix-toolset.687559.n2.nabble.com
> > > How to debug CustomAction DLL. Dear Wix Experts: We have a
> > > CustomAction
> > DLL
> > > written in C. How to debug it? There are a few posts about it:
> Post1:...
> > >
> > >
> > > ________________________________
> > > From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf
> > > of
> > Alex
> > > Tuppen <alex.tuppen at gmail.com>
> > > Sent: Tuesday, March 28, 2017 8:44:35 AM
> > > To: WiX Toolset Users Mailing List
> > > Subject: Re: [wix-users] COM Object exception
> > >
> > > I have finally had the time to get this working so first a massive
> > > thank you for pointing me in the right direction. However now I
> > > cannot work out how to have the MSI return anything other than an
> > > error. I assume that
> > this
> > > is because the MSI is not actually doing anything other than running
> > > the custom action, what is the best way to resolve this?
> > >
> > > Alternatively this could be because the CA is erroring and I have
> > > not
> > been
> > > able to enable verbose logging of the MSI when running it from
> > > within the bootstrapper (I can see that most of the CA runs outside
> > > the bootstrapper but it relies on some logic in the bootstrapper for
> > > a variable so it
> > always
> > > errors outside). Is there a way to force verbose logging while I am
> > > developing?
> > >
> > > Thank you,
> > >
> > > Alex
> > >
> > > On Wed, 22 Feb 2017 at 17:17 Hoover, Jacob
> > > <Jacob.Hoover at greenheck.com>
> > > wrote:
> > >
> > > > WixStdBA already does this. Have a look @ OnExecuteMsiMessage.
> > > > Note if
> > > you
> > > > want super detailed progress you need a custom them that includes
> > > > a ExecuteProgressActionDataText control.
> > > >
> > > > -----Original Message-----
> > > > From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On
> > > Behalf
> > > > Of Alex Tuppen
> > > > Sent: Wednesday, February 22, 2017 3:35 AM
> > > > To: WiX Toolset Users Mailing List
> > > > <wix-users at lists.wixtoolset.org>
> > > > Subject: Re: [wix-users] COM Object exception
> > > >
> > > > Feedback from the install progress and messages, what is the best
> > > > way
> > to
> > > > pass that back?
> > > >
> > > > On Tue, 21 Feb 2017 at 23:20 Hoover, Jacob
> > > > <Jacob.Hoover at greenheck.com
> > >
> > > > wrote:
> > > >
> > > > > Define information?  If you are using burn, normally the BA
> > > > > would collect any configuration information and pass it to the
> > > > > MSI as a property. If you are talking about feedback from the
> > > > > install progress and messages, then yes. If you are using
> DisplayInternalUI then no.
> > > > >
> > > > > -----Original Message-----
> > > > > From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org]
> > > > > On Behalf Of Alex Tuppen
> > > > > Sent: Tuesday, February 21, 2017 3:38 PM
> > > > > To: WiX Toolset Users Mailing List
> > > > > <wix-users at lists.wixtoolset.org>
> > > > > Subject: Re: [wix-users] COM Object exception
> > > > >
> > > > > That makes sense, is it possible to pass information from an MSI
> > > > > back to bootstrapper for the GUI?
> > > > >
> > > > > On Tue, 21 Feb 2017 at 19:53 Hoover, Jacob
> > > > > <Jacob.Hoover at greenheck.com>
> > > > > wrote:
> > > > >
> > > > > > You could create a MSI with your configuration in it and put
> > > > > > it in the chain after the MMA MSI.
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: wix-users
> > > > > > [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
> > > > > > Alex Tuppen
> > > > > > Sent: Tuesday, February 21, 2017 1:36 PM
> > > > > > To: WiX Toolset Users Mailing List
> > > > > > <wix-users at lists.wixtoolset.org
> > >
> > > > > > Subject: Re: [wix-users] COM Object exception
> > > > > >
> > > > > > Are there any options if the MSI I am installing is not one
> > > > > > that I have made? I looked at custom actions but I can't run
> > > > > > those in the bundle itself. Basically I am just installing the
> > > > > > MMA and then configuring it to point to Azure where the actual
> > > > > > work is done (hence why I am not installing anything that i have
> written).
> > > > > >
> > > > > > On Tue, 21 Feb 2017 at 17:54 Phill Hogland
> > > > > > <phill.hogland at rimage.com>
> > > > > > wrote:
> > > > > >
> > > > > > > A BA should not try to implement any configuration changes.
> > > > > > > You might look at using a DTF CA in a chained MSI or as
> > > > > > > there is a similar PowerShell script posted in the following
> > > > > > > link then consider using the
> > > > > > Wix PSExtension.
> > > > > > >
> > > > > > > ________________________________
> > > > > > > From: wix-users <wix-users-bounces at lists.wixtoolset.org> on
> > behalf
> > > > > > > of Alex Tuppen <alex.tuppen at gmail.com>
> > > > > > > Sent: Tuesday, February 21, 2017 10:37:54 AM
> > > > > > > To: wix-users at lists.wixtoolset.org
> > > > > > > Subject: [wix-users] COM Object exception
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I was wondering if there is anything that I need to do to be
> > > > > > > able to use a COM object from within a custom bootstrapper.
> > > > > > > I have the same COM object working outside the bootstrapper
> > > > > > > but no matter what I try it always throws an exception when
> > > > > > > the bootstrapper
> > > tries
> > > > to use it.
> > > > > > >
> > > > > > > The COM object in question is for the Microsoft Monitoring
> > > > > > > Agent and is registered when the MMA is installed. I am
> > > > > > > attempting to use it with the following code:
> > > > > > >
> > > > > > >         public async Task<string> ConfigureOMSAgent()
> > > > > > >         {
> > > > > > >             return await Task.Run(() =>
> > > > > > >             {
> > > > > > >                 try
> > > > > > >                 {
> > > > > > >                     // Load COM object
> > > > > > >
> > > > > > > Bootstrapper.Engine.Log(LogLevel.Verbose,
> > > > > > > "Loading ManagementServiceConfiguration COM object");
> > > > > > >
> > > > > > > AgentConfigManagerLib.ManagementServiceConfiguration
> > > > > > > mgmntSrvCnfg = new
> > > > > > AgentConfigManagerLib.ManagementServiceConfiguration();
> > > > > > >                     // Configuring MMA as OMS agent
> > > > > > >
> > > > > > > Bootstrapper.Engine.Log(LogLevel.Verbose,
> > > > > > > "Configuring MMA as OMS agent");
> > > > > > >
> > > > > > > mgmntSrvCnfg.AddCloudWorkspace(WorkSpaceID,
> > > > > > > WorkSpaceKey);
> > > > > > >                     // Return empty string indicating success
> > > > > > >                     return string.Empty;
> > > > > > >                 }
> > > > > > >                 catch (Exception e)
> > > > > > >                 {
> > > > > > >                     ErrorThrown(e.Message);
> > > > > > >                     return e.Message;
> > > > > > >                 }
> > > > > > >             });
> > > > > > >         }
> > > > > > >
> > > > > > > Any help will be amazing!
> > > > > > >
> > > > > > > Thank you,
> > > > > > >
> > > > > > > Alex
> > > > > > >
> > > > > > >
> > __________________________________________________________________
> > > > > > > __ WiX Toolset Users Mailing List provided by FireGiant
> > > > > > > http://www.firegiant.com/
> > > > > > >
> > > > > > >
> > __________________________________________________________________
> > > > > > > __ WiX Toolset Users Mailing List provided by FireGiant
> > > > > > > http://www.firegiant.com/
> > > > > > >
> > > > > >
> > > > > >
> > ____________________________________________________________________
> > > > > > WiX Toolset Users Mailing List provided by FireGiant
> > > > > > http://www.firegiant.com/
> > > > > >
> > > > > >
> > ____________________________________________________________________
> > > > > > WiX Toolset Users Mailing List provided by FireGiant
> > > > > > http://www.firegiant.com/
> > > > > >
> > > > >
> > > > > ________________________________________________________________
> > > > > ____ WiX Toolset Users Mailing List provided by FireGiant
> > > > > http://www.firegiant.com/
> > > > >
> > > > > ________________________________________________________________
> > > > > ____ WiX Toolset Users Mailing List provided by FireGiant
> > > > > http://www.firegiant.com/
> > > > >
> > > >
> > > > __________________________________________________________________
> > > > __ WiX Toolset Users Mailing List provided by FireGiant
> > > > http://www.firegiant.com/
> > > >
> > > > __________________________________________________________________
> > > > __ WiX Toolset Users Mailing List provided by FireGiant
> > > > http://www.firegiant.com/
> > > >
> > >
> > > ____________________________________________________________________
> > > WiX Toolset Users Mailing List provided by FireGiant
> > > http://www.firegiant.com/
> > >
> > > ____________________________________________________________________
> > > WiX Toolset Users Mailing List provided by FireGiant
> > > http://www.firegiant.com/
> > >
> > > ____________________________________________________________________
> > > WiX Toolset Users Mailing List provided by FireGiant
> > > http://www.firegiant.com/
> > >
> > > ____________________________________________________________________
> > > WiX Toolset Users Mailing List provided by FireGiant
> > > http://www.firegiant.com/
> > >
> >
> > ____________________________________________________________________
> > WiX Toolset Users Mailing List provided by FireGiant
> > http://www.firegiant.com/
> >
> >
> > This message has been scanned for malware by Websense.
> > www.websense.com
> >
> > ____________________________________________________________________
> > WiX Toolset Users Mailing List provided by FireGiant
> > http://www.firegiant.com/
> >
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
> NOTICE: This electronic mail message and any files transmitted with it are
> intended
> exclusively for the individual or entity to which it is addressed. The
> message,
> together with any attachment, may contain confidential and/or privileged
> information.
> Any unauthorized review, use, printing, saving, copying, disclosure or
> distribution
> is strictly prohibited. If you have received this message in error, please
> immediately advise the sender by reply email and delete all copies.
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>


More information about the wix-users mailing list