[wix-users] Executing an already installed program at install and uninstall time
Farrukh Waheed
farrukh1 at gmail.com
Thu Jun 23 23:41:56 PDT 2016
Phil, thanks for your effort and time.
Finally, to launch an already installed program while passing arguments, I
ended up with following successfully:
<?define RegToolInstallDirEnvVar="%$(var.RegToolEnvVar)"?>
<!--Setting property and in Value, using the environment variable-->
<SetProperty Id="REG_MODULE"
Before="InstallInitialize"
Sequence="execute"
Value="[$(var.RegToolInstallDirEnvVar)]RegisterModule.exe">
</SetProperty>
<CustomAction
Id="RegProbPath"
Property="REG_MODULE"
Execute="deferred"
Impersonate="no"
Return="asyncWait"
ExeCommand="/p "[INSTALLDIR]$(var.ProductSuiteName)
$(var.ProductName)_$(var.ProductVersion)" /c RegTool.exe.config"
/>
WixShellExec seems to be launching any file with its Shell association e.g.
*.pdf, *.txt, *.doc etc. *.exe files are by default executables and so
WixShellExec do the job. But we can't pass arguments here.
On 23 June 2016 at 08:59, Farrukh Waheed <farrukh1 at gmail.com> wrote:
> Ok, so it is working now. But I can't provide any arguments to the
> application here. Tried to use attribute ExeCommand for passing arguments,
> but got following error:
> D:\TestMsis\Notepad.wxs(40) : error CNDL0023 : The
> CustomAction/@ExeCommand attribute cannot coexist with a previously
> specified attribute on this element. The CustomAction element may only
> have one of the following target attributes specified at a time: DllEntry,
> Error, ExeCommand, JScriptCall, Script, Value, or VBScriptCall.
>
>
> Here is my code snippet:
>
> <Property Id="WixShellExecTarget" Value="Notepad.exe" />
> <CustomAction Id="LaunchApplication"
> BinaryKey="WixCA"
> DllEntry="WixShellExec"
> Impersonate="yes"
> ExeCommand=""C:\Users\TestUser\Desktop\MyText.txt"" />
>
>
> Found this thread:
>
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Passing-command-line-arguments-to-an-app-launched-after-setup-td1366362.html
>
> Seems like we can't pass arguments to our executing application here.
>
> On 23 June 2016 at 08:22, Farrukh Waheed <farrukh1 at gmail.com> wrote:
>
>> I'm working on Managed Bootstrapper and read about this here actually:
>>
>> http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html
>>
>>
>>
>> On 22 June 2016 at 21:27, Phil Wilson <phil.wilson at mvps.org> wrote:
>>
>>> It's just a custom action call - just call it. Not sure where you got the
>>> button thought from.
>>> Phil W
>>>
>>> -----Original Message-----
>>> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On
>>> Behalf Of
>>> Farrukh Waheed
>>> Sent: Wednesday, June 22, 2016 2:12 AM
>>> To: WiX Toolset Users Mailing List
>>> Subject: Re: [wix-users] Executing an already installed program at
>>> install
>>> and uninstall time
>>>
>>> But this way requires a button on UI to launch the app, correct? I need
>>> to
>>> run such CA simply at the end of Installation/Uninstallation process.
>>>
>>> On 22 June 2016 at 02:38, Phil Wilson <phil.wilson at mvps.org> wrote:
>>>
>>> > WixShellExec
>>>
>>> ____________________________________________________________________
>>> WiX Toolset Users Mailing List provided by FireGiant
>>> http://www.firegiant.com/
>>>
>>>
>>>
>>> ____________________________________________________________________
>>> WiX Toolset Users Mailing List provided by FireGiant
>>> http://www.firegiant.com/
>>>
>>
>>
>
More information about the wix-users
mailing list