Quantcast

how do I start an application after install, not conditionally and not based on clicking on dialog

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how do I start an application after install, not conditionally and not based on clicking on dialog

bryan rasmussen
As per the subject line, it's just supposed to install and run. The
user doesn't have to click on the dialog to say that they want it to
run.

Thanks,
Bryan Rasmussen

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how do I start an application after install, not conditionally and not based on clicking on dialog

bryan rasmussen
Specifically I am trying to do this:


     <CustomAction Id="CA1" Property="CA1_PROP"
Value="[AUTOPILOT]AutoPilot.exe" />

<InstallExecuteSequence>
<InstallFinalize/>
      <Custom Action="CA1" After="InstallFinalize" />

    </InstallExecuteSequence>

How should that be restructured to work?

Thanks,
Bryan Rasmussen

On Thu, Jun 26, 2008 at 9:47 AM, bryan rasmussen
<[hidden email]> wrote:
> As per the subject line, it's just supposed to install and run. The
> user doesn't have to click on the dialog to say that they want it to
> run.
>
> Thanks,
> Bryan Rasmussen
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how do I start an application after install, not conditionally and not based on clicking on dialog

Neil Enns
Bryan,

I have a new how-to topic out for review that covers launching an application based on a checkbox at the end of setup. I've included the text of it below. Assuming your installer has UI, you can wire up the action in the same way (to the Finish button), but simply omit the piece that turns on the checkbox and the condition for verifying the checkbox.

I hope this helps,

Neil

How To: Run the Installed Application After Setup

Often when completing the installation of an application it is desirable to offer the user the option of immediately launching the installed program when setup is complete. This how to describes customizing the default WiX UI experience to include a checkbox and a WiX custom action to launch the application if the checkbox is checked.

This how to assumes you have already created a basic WiX project using the steps outlined in How To: Add a file to your installer.

Step 1: Add the extension libraries to your project

This walkthrough requires WiX extensions for UI components and custom actions. These extension libraries must must be added to your project prior to use. If you are using WiX on the command-line you need to add the following to your candle and light command lines:

-ext WixUIExtension -ext WixUtilExtension

If you are using Votive you can add the extensions using the Add Reference dialog:

Right click on your project in Solution Explorer and select Add Reference...
Select the WixUIExtension.dll assembly from the list and click Add
Select the WixUtilExtension.dll assembly from the list and click Add
Close the Add Reference dialog

Step 2: Add UI to your installer

The WiX Minimal UI sequence includes a basic set of dialogs that includes a finished dialog with optional checkbox. To include the sequence in your project add the following snippet anywhere inside the <Product> element.

<UI>
    <UIRef Id="WixUI_Minimal" />
</UI>

To display the checkbox on the last screen of the installer include the following snippet anywhere inside the <Product> element:

<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application Name" />
The WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT property is provided by the standard UI sequence that, when set, displays the checkbox and uses the specified value as the checkbox label.

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:

<Property Id="WixShellExecTarget" Value="[#myapplication.exe]" />
<CustomAction Id="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 keyfile for the component 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.

Step 4: Trigger the custom action

Simply including the custom action, as in Step 3, isn't sufficient to cause it to run. Windows Installer must also be told when the custom action should be triggered. This is done by using the <Publish> element to add it to the actions run when the user clicks the Finished button on the final page of the UI dialogs. The Publish element should be included inside the <UI> element from Step 2, and looks like this:

<Publish Dialog="ExitDialog"
    Control="Finish"
    Event="DoAction"
    Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>

The Dialog property specifies the dialog the Custom Action will be attached to, in this case the ExitDialog. The Control property specifies that the Finish button on the dialog triggers the custom action. The Event property indicates that a custom action should be run when the button is clicked, and the Value property specifies the custom action that was included in Step 3. The condition on the element prevents the action from running unless the checkbox from Step 2 was checked and the application was actually installed (as opposed to being removed or repaired).


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of bryan rasmussen
Sent: Thursday, June 26, 2008 1:12 AM
To: [hidden email]
Subject: Re: [WiX-users] how do I start an application after install, not conditionally and not based on clicking on dialog

Specifically I am trying to do this:


     <CustomAction Id="CA1" Property="CA1_PROP"
Value="[AUTOPILOT]AutoPilot.exe" />

<InstallExecuteSequence>
<InstallFinalize/>
      <Custom Action="CA1" After="InstallFinalize" />

    </InstallExecuteSequence>

How should that be restructured to work?

Thanks,
Bryan Rasmussen

On Thu, Jun 26, 2008 at 9:47 AM, bryan rasmussen
<[hidden email]> wrote:
> As per the subject line, it's just supposed to install and run. The
> user doesn't have to click on the dialog to say that they want it to
> run.
>
> Thanks,
> Bryan Rasmussen
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how do I start an application after install, not conditionally and not based on clicking on dialog

Alexander Shevchuk
In reply to this post by bryan rasmussen
Hi Bryan,

I don't know details how you get the value of AUTOPILOT property.  If that's you installation path - use custom action type 18, if you are getting it using AppSearch - custom action type 50.  Here is the sample of type 18 (Write.exe is from [SystemFolder] on my Vista machine):


<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">

  <Product Id="{0BD4334D-F9FE-4B70-8070-917288A50B51}"
           Name="Minimal Windows Installer Sample"
           Language="1033"
           Codepage="1252"
           Version="1.0.0"
           Manufacturer="Acme Corporation"
           UpgradeCode="{770C5598-A538-4D44-8C2E-B2D94E15CC98}">

    <Package Id="{E1782FB0-3D87-4B13-88DC-62E11FB72552}"
             Description="Minimal Windows Installer Sample"
             Comments="This installer database contains the logic and data required to install [ProductName]."
             InstallerVersion="200"
             Languages="1033"
             SummaryCodepage="1252"
             Platforms="Intel"
             ReadOnly="no"
             Compressed="yes"
             AdminImage="no"
             Keywords="Installer"
             ShortNames ="no"
             Manufacturer="Acme Corporation" />

    <Media Id="1" Cabinet="CAB001.cab" EmbedCab="yes" />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="Minimal" LongName="MinimalInstallation">

          <Component Id="Component1"
                     Guid="{A77C5B06-132D-4884-8E17-EA10A83C812D}">
            <File Id="Write.exe" DiskId="1" Name="Write.exe" Source="Write.exe" Vital="yes" KeyPath="yes" />
            <File Id="ReadMe" DiskId="1" Name="Readme.txt" Source="Readme.txt" Vital="yes" KeyPath="no" />
          </Component>

        </Directory>
      </Directory>
    </Directory>

    <CustomAction Id="ShowReadMe"
                  FileKey="Write.exe"
                  ExeCommand='"[#ReadMe]"'
                  Return="asyncNoWait" />

    <InstallExecuteSequence>
      <Custom Action="ShowReadMe" After="InstallFinalize">Not Installed</Custom>
    </InstallExecuteSequence>

    <Feature Id="Feature1"
             Title="Feature1 title"
             Description="Feature1 description"
             Level="1"
             ConfigurableDirectory="INSTALLDIR" >
      <ComponentRef Id="Component1" />
    </Feature>

  </Product>
</Wix>


Alex Shevchuk




-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of bryan rasmussen
Sent: Thursday, June 26, 2008 1:12 AM
To: [hidden email]
Subject: Re: [WiX-users] how do I start an application after install, not conditionally and not based on clicking on dialog

Specifically I am trying to do this:


     <CustomAction Id="CA1" Property="CA1_PROP"
Value="[AUTOPILOT]AutoPilot.exe" />

<InstallExecuteSequence>
<InstallFinalize/>
      <Custom Action="CA1" After="InstallFinalize" />

    </InstallExecuteSequence>

How should that be restructured to work?

Thanks,
Bryan Rasmussen

On Thu, Jun 26, 2008 at 9:47 AM, bryan rasmussen
<[hidden email]> wrote:
> As per the subject line, it's just supposed to install and run. The
> user doesn't have to click on the dialog to say that they want it to
> run.
>
> Thanks,
> Bryan Rasmussen
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how do I start an application after install, not conditionally and not based on clicking on dialog

Rob Mensching-2
In reply to this post by bryan rasmussen
Also, you can be a bit more robust in your File reference by doing "[#AutoPilotFileId]" instead of "[AUTOPILOT]AutoPilot.exe"

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of bryan rasmussen
Sent: Thursday, June 26, 2008 01:12
To: [hidden email]
Subject: Re: [WiX-users] how do I start an application after install, not conditionally and not based on clicking on dialog

Specifically I am trying to do this:


     <CustomAction Id="CA1" Property="CA1_PROP"
Value="[AUTOPILOT]AutoPilot.exe" />

<InstallExecuteSequence>
<InstallFinalize/>
      <Custom Action="CA1" After="InstallFinalize" />

    </InstallExecuteSequence>

How should that be restructured to work?

Thanks,
Bryan Rasmussen

On Thu, Jun 26, 2008 at 9:47 AM, bryan rasmussen
<[hidden email]> wrote:
> As per the subject line, it's just supposed to install and run. The
> user doesn't have to click on the dialog to say that they want it to
> run.
>
> Thanks,
> Bryan Rasmussen
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Loading...