Discussion:
[WiX-users] WiX 3.0: How to run a program
little.forest
2009-06-04 22:30:16 UTC
Permalink
Hi,

We're using WiX 3.0.4805.0.

Question: how to run a program? We'd like to run it after all files installed but before the main application running.

Here is the code which doesn't work - the test.exe program never run during installation:
<Component Id="ComponentTestExe" Guid="...">
<File Id="TestExe" Source="test.exe" KeyPath="yes" Checksum="yes"/>
</Component>
...
<CustomAction Id="RunTestExe" FileKey="TestExe" ExeCommand='' Return="asyncWait" />
...
<InstallExecuteSequence>
<Custom Action="RunTestExe" After="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
...
<ComponentRef Id ="ComponentTestExe"/>

Can you please point out the errors? Thanks a lot..

/Brian



__________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!

http://www.flickr.com/gift/
Rob Mensching
2009-06-05 03:43:08 UTC
Permalink
I'm pretty sure the WiX.chm has a topic about exactly this case.
Post by little.forest
Hi,
We're using WiX 3.0.4805.0.
Question: how to run a program? We'd like to run it after all files installed but before the main application running.
<Component Id="ComponentTestExe" Guid="...">
<File Id="TestExe" Source="test.exe" KeyPath="yes" Checksum="yes"/>
</Component>
...
<CustomAction Id="RunTestExe" FileKey="TestExe" ExeCommand='' Return="asyncWait" />
...
<InstallExecuteSequence>
<Custom Action="RunTestExe" After="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
...
<ComponentRef Id ="ComponentTestExe"/>
Can you please point out the errors? Thanks a lot..
/Brian
__________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!
http://www.flickr.com/gift/
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
little.forest
2009-06-05 19:05:10 UTC
Permalink
Hi Rob,

Thank you very much for your response.

Actually, I did read the Wix.chm and found a topic "How To: Run the Installed Application After Setup". Do you mean this topic? If it's not, then could you please tell me a few key words that I can use to search the topic?

For the topic "How To: Run the Installed Application After Setup", I did copy the code and actually using it for our "luanching application when exit" case. But in our special case, besides the final "launching application when exit", we also need to run another program right after installation but before "launching the main application". Namely, we will need to run 2 program after installation: one is a small program which needs to be run before the main application startup(and it needs to run until finished); another one is the main application which is already implemented by using the code from Wix.chm. How can I do this?

For "launching application when exit" case, I followed the document and got it work already. But I can't get the "run another small program" working. Also, even though the "launching application when exit" works, I'm not quite sure the meaning of the code. For example, this part(I just copy the text from Wix.chm):
...............................
Step 3: Include the custom action
Custom actions are included in a WiX project using the <CustomAction> element. Running an application is accomplished with the WixShellExecTarget custom action. To tell Windows Installer about the custom action, and to set its properties, include the following in your project anywhere inside the <Product> element:<PropertyId="WixShellExecTarget"Value="[#myapplication.exe]"/>
<CustomActionId="LaunchApplication"BinaryKey="WixCA"DllEntry="WixShellExec"Impersonate="yes"/>
The Property element sets the WixShellExecTarget to the location of the installed application. WixShellExecTarget is the property Id the WixShellExec custom action expects will be set to the location of the file to run. The Value property uses the special # character to tell WiX to look up the full installed path of the file with the id myapplication.exe.
The CustomAction element includes the action in the installer. It is given a unique Id, and the BinaryKey and DllEntry properties indicate the assembly and entry point for the custom action. The Impersonate property tells Windows Installer to run the custom action as the installing user.
...............................
 
 
=============================
Here are a few questions:
=============================
1. The property "WixShellExecTarget": I understand this property maybe a pre-defined property. I'll just need to define it to provide the value which is the application executable file. Does it mean I must use this property name if I need to run another program? I think the answer is NO. But then what kind of property name I should use if it's not the "launch application" case? Or it doesn't matter? Can I use some like "MyExec2", for instance?
 
2. For CustomAction "BinaryKey", it's "WixCA". I found the definition for "BinaryKey" from Wix.chm:
...............................
This attribute is a reference to a Binary element with matching Id attribute. That binary stream contains the custom action for use during install. The custom action will not be installed into a target directory. This attribute is typically used with the DllEntry attribute to specify the custom action DLL to use for a type 1 custom action, with the ExeCommand attribute to specify a type 17 custom action that runs an embedded executable, or with the VBScriptCall or JScriptCall attributes to specify a type 5 or 6 custom action.
...............................
I guess it's a key used when launching application? Can I use it in our "run another program" case?
 
3. For DllEntry, it's "WixShellExec". I found the info about it:
...............................
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. 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." For more information, see ShellExecute Function.
...............................
But in our case, we need to "run that small program and wait until it finished before launching the main application" instead of "as it launches an application without waiting for it to close". Can I use this "launch application" example in our case?
 
4. Anyways, I thought maybe it'll work if I use the code from this example in the Wix.chm. So I had this piece of code for our small program:
<Property Id="WixShellExecTarget2" Value="[#TestExe]" />
<CustomAction Id="RunMyExe" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<InstallExecuteSequence>
    <Custom Action="RunTestExe" After="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
 
But when I run it, I got "Setup Wizard ended prematurely" error.
 
5. As it doesn't work, I searched the forum for answers. Then got these code which doesn't work either:
<CustomAction Id="RunTestExe" FileKey="TestExe" ExeCommand='' Return="asyncWait" /> 
<InstallExecuteSequence> 
    <Custom Action="RunTestExe" After="InstallFiles">NOT Installed</Custom> 
</InstallExecuteSequence> 

 
I really appreciate if you or anyone else can give me some clue. We're currectly stuck on it.
 
Many many thanks.
 
/Brian


__________________________________________________________________
Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://ca.promos.yahoo.com/newmail/overview2/
little.forest
2009-06-23 21:51:17 UTC
Permalink
Hi,

I re-read the wix.chm and found "Quiet Execution Custom Action".

I tried to use the example in wix.chm. But when I run it, I got these errors:
MSI (s) (68!58) [13:58:06:803]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"[INSTALLLOCATION]abc.exe"'.
CAQuietExec:  Error 0x80070003: Command failed to execute.
CAQuietExec:  Error 0x80070003: CAQuietExec Failed
Action ended 13:58:06: QtExecExample.. Return value 3.

Here is my code:
      <Property Id="QtExecCmdLine" Value='"[INSTALLLOCATION]abc.exe"'/>
      <CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
      <InstallExecuteSequence>
        <Custom Action="QtExecExample" Before="InstallFinalize"/>
      </InstallExecuteSequence>

I'd like to run this "abc.exe" program after the installation but before the main application got launched(which is controlled by a checkbox on the final page). Can someone point out the errors here?

I did check the "C:\Program Files\MyApp" folder, the files are not even installed. That maybe the reason that abc.exe is not run? Is it okay to run it before "InstallFinalize"? If not, which action sequence I should use?

I'd really appreciate it.

/Brian


__________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
little.forest
2009-06-24 17:21:31 UTC
Permalink
Can you WiX experts take a bit of your time to point me out the problems below? I used exactly the example code from wix.chm, but it doesn't work for me. Am I doing the right thing? I really appreciate it if you can give me some clue.

Basically, I'd just like to run a small program right after the installation but before the main application getting launched.

Thank you!

/Brian




________________________________
From: little.forest <***@ymail.com>
To: General discussion for Windows Installer XML toolset. <wix-***@lists.sourceforge.net>
Sent: Tuesday, June 23, 2009 2:51:17 PM
Subject: Re: [WiX-users] WiX 3.0: How to run a program

Hi,

I re-read the wix.chm and found "Quiet Execution Custom Action".

I tried to use the example in wix.chm. But when I run it, I got these errors:
MSI (s) (68!58) [13:58:06:803]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"[INSTALLLOCATION]abc.exe"'.
CAQuietExec:  Error 0x80070003: Command failed to execute.
CAQuietExec:  Error 0x80070003: CAQuietExec Failed
Action ended 13:58:06: QtExecExample.. Return value 3.

Here is my code:
      <Property Id="QtExecCmdLine" Value='"[INSTALLLOCATION]abc.exe"'/>
      <CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
      <InstallExecuteSequence>
        <Custom Action="QtExecExample" Before="InstallFinalize"/>
      </InstallExecuteSequence>

I'd like to run this "abc.exe" program after the installation but before the main application got launched(which is controlled by a checkbox on the final page). Can someone point out the errors here?

I did check the "C:\Program Files\MyApp" folder, the files are not even installed. That maybe the reason that abc.exe is not run? Is it okay to run it before "InstallFinalize"? If not, which action sequence I should use?

I'd really appreciate it.

/Brian


      __________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



__________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!

http://www.flickr.com/gift/
Wilson, Phil
2009-06-24 17:26:38 UTC
Permalink
Execute=Immediate is before any files are installed. It needs to be deferred.

Phil Wilson

-----Original Message-----
From: little.forest [mailto:***@ymail.com]
Sent: Wednesday, June 24, 2009 10:22 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] WiX 3.0: How to run a program

Can you WiX experts take a bit of your time to point me out the problems below? I used exactly the example code from wix.chm, but it doesn't work for me. Am I doing the right thing? I really appreciate it if you can give me some clue.

Basically, I'd just like to run a small program right after the installation but before the main application getting launched.

Thank you!

/Brian




________________________________
From: little.forest <***@ymail.com>
To: General discussion for Windows Installer XML toolset. <wix-***@lists.sourceforge.net>
Sent: Tuesday, June 23, 2009 2:51:17 PM
Subject: Re: [WiX-users] WiX 3.0: How to run a program

Hi,

I re-read the wix.chm and found "Quiet Execution Custom Action".

I tried to use the example in wix.chm. But when I run it, I got these errors:
MSI (s) (68!58) [13:58:06:803]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"[INSTALLLOCATION]abc.exe"'.
CAQuietExec:  Error 0x80070003: Command failed to execute.
CAQuietExec:  Error 0x80070003: CAQuietExec Failed
Action ended 13:58:06: QtExecExample.. Return value 3.

Here is my code:
      <Property Id="QtExecCmdLine" Value='"[INSTALLLOCATION]abc.exe"'/>
      <CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
      <InstallExecuteSequence>
        <Custom Action="QtExecExample" Before="InstallFinalize"/>
      </InstallExecuteSequence>

I'd like to run this "abc.exe" program after the installation but before the main application got launched(which is controlled by a checkbox on the final page). Can someone point out the errors here?

I did check the "C:\Program Files\MyApp" folder, the files are not even installed. That maybe the reason that abc.exe is not run? Is it okay to run it before "InstallFinalize"? If not, which action sequence I should use?

I'd really appreciate it.

/Brian


      __________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



__________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!

http://www.flickr.com/gift/
------------------------------------------------------------------------------
little.forest
2009-06-25 01:03:25 UTC
Permalink
Hi Phil,

Thank you so much for your reply.

I got it working. Here is the code:
        <CustomAction Id="Exec_Cmd"
                      Property="ExecProperty"
                      Value="&quot;[#abc.exe]&quot;"
                      Execute="immediate"/>
        <CustomAction Id="ExecProperty"
                      BinaryKey="WixCA"
                      DllEntry="CAQuietExec"
                      Execute="deferred"
                      Return="ignore"
                      Impersonate="no"/>
        <InstallExecuteSequence>
            <Custom Action="Exec_Cmd" After="CostFinalize"/>
            <Custom Action="ExecProperty" Before="InstallFinalize"/>
        </InstallExecuteSequence>

However I also have a couple of questions:
1. If I try to use "asyncNoWait" as the "Return" type, I'm getting this error:
The CustomAction/@Return attribute's value, 'asyncNoWait', cannot be specified without attribute ExeCommand present.
How can I resolve this?

2. About the customaction sequence, I was told that I can't "schedule a custom action after InstallFinalize". So I schedule it "Before the InstallFinalize". But is it gauranteed that the customaction must happen after "Exec_Cmd"? Can I make it something like After="Exec_Cmd"? If I do so, will the result be the same? Or, the "ExecProperty" action would have a different sequence from the current one?

Thanks.





________________________________
From: "Wilson, Phil" <***@wonderware.com>
To: General discussion for Windows Installer XML toolset. <wix-***@lists.sourceforge.net>
Sent: Wednesday, June 24, 2009 10:26:38 AM
Subject: Re: [WiX-users] WiX 3.0: How to run a program

Execute=Immediate is before any files are installed.  It needs to be deferred.

Phil Wilson

-----Original Message-----
From: little.forest [mailto:***@ymail.com]
Sent: Wednesday, June 24, 2009 10:22 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] WiX 3.0: How to run a program

Can you WiX experts take a bit of your time to point me out the problems below? I used exactly the example code from wix.chm, but it doesn't work for me. Am I doing the right thing? I really appreciate it if you can give me some clue.

Basically, I'd just like to run a small program right after the installation but before the main application getting launched.

Thank you!

/Brian




________________________________
From: little.forest <***@ymail.com>
To: General discussion for Windows Installer XML toolset. <wix-***@lists.sourceforge..net>
Sent: Tuesday, June 23, 2009 2:51:17 PM
Subject: Re: [WiX-users] WiX 3.0: How to run a program

Hi,

I re-read the wix.chm and found "Quiet Execution Custom Action".

I tried to use the example in wix.chm. But when I run it, I got these errors:
MSI (s) (68!58) [13:58:06:803]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"[INSTALLLOCATION]abc.exe"'.
CAQuietExec:  Error 0x80070003: Command failed to execute.
CAQuietExec:  Error 0x80070003: CAQuietExec Failed
Action ended 13:58:06: QtExecExample.. Return value 3.

Here is my code:
      <Property Id="QtExecCmdLine" Value='"[INSTALLLOCATION]abc.exe"'/>
      <CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
      <InstallExecuteSequence>
        <Custom Action="QtExecExample" Before="InstallFinalize"/>
      </InstallExecuteSequence>

I'd like to run this "abc.exe" program after the installation but before the main application got launched(which is controlled by a checkbox on the final page). Can someone point out the errors here?

I did check the "C:\Program Files\MyApp" folder, the files are not even installed. That maybe the reason that abc.exe is not run? Is it okay to run it before "InstallFinalize"? If not, which action sequence I should use?

I'd really appreciate it.

/Brian


      __________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!

http://www.flickr.com/gift/
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



__________________________________________________________________
Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
Bob Arnson
2009-06-25 15:49:46 UTC
Permalink
You can't use that with a DLL custom action, which is what QuietExec is.
Post by little.forest
Can I make it something like After="Exec_Cmd"?
Yes.
--
sig://boB
http://joyofsetup.com/
little.forest
2009-06-26 21:59:34 UTC
Permalink
Thanks Bob!

So that means, if I need to run an executable as "asyncNoWait", then I'll have to use a different kind of customaction? If so, do you know what that type of customaction is?

Thanks.




________________________________
From: Bob Arnson <***@joyofsetup.com>
To: General discussion for Windows Installer XML toolset. <wix-***@lists.sourceforge.net>
Sent: Thursday, June 25, 2009 8:49:46 AM
Subject: Re: [WiX-users] WiX 3.0: How to run a program
Post by little.forest
 
You can't use that with a DLL custom action, which is what QuietExec is.
Post by little.forest
Can I make it something like After="Exec_Cmd"?
Yes.
--
sig://boB
http://joyofsetup.com/



------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



__________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com
Bob Arnson
2009-06-30 03:14:06 UTC
Permalink
Post by little.forest
So that means, if I need to run an executable as "asyncNoWait", then I'll have to use a different kind of customaction? If so, do you know what that type of customaction is?
See the MSI SDK topic "Custom Action Return Processing Options."
--
sig://boB
http://joyofsetup.com/
Continue reading on narkive:
Loading...