A couple of "best practice"  suggestions related to this, if I'm
guessing the intent behind those CAs:

1. Why task kill? If this is a program that responds to Windows
commands, the WiX util CloseApplication custom action might be better,
especially if an orderly closedown is preferred rather than a forced
termination.

2. Why delete a program if you just installed it? a) If you really
installed it and then you delete it you may not be aware that Windows
will think the product install is broken and repair it, leading to
requests for the install medium. b) If it's for a custom action you
don't need to install it to run it - there are types of custom action
you can run that don't need files to be installed because they are
stored separately and Windows will stream them out temporarily to run
them.
---------------
Phil Wilson


On Wed, May 7, 2014 at 1:39 PM, Pavan Konduru
<pavan.kond...@accelrys.com> wrote:
> This way:
>
> <CustomAction Id="SetPropLoc" Property="MyCA" Value="[INSTALLFOLDER]" 
> Execute="immediate"/>
>     <CustomAction Id=" MyCA " BinaryKey="CustomAction" DllEntry=" MyCA " 
> Return="check" Execute='deferred' Impersonate='no'/>
>
> <InstallExecuteSequence>
>         <Custom Action=" SetPropLoc "      Before=" MyCA "></Custom>
>          <Custom Action=" MyCA "      After="InstallInitialize"></Custom>
> </InstallExecuteSequence>
>
> In your customaction(MyCA here in the example). C# code:
>
> string location = session["CustomActionData"];
>
>
> location would hold the INSTALLFOLDER value.
>
> --Pavan
>
>
> -----Original Message-----
> From: dysert [mailto:b...@rocketmail.com]
> Sent: Wednesday, May 07, 2014 1:24 PM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Running DOS commands from installation
>
> *I posted the following at the main forum, and it was suggested I post here
> instead...*
> I've written an installation package with WiX (3.6), and I want to be able to 
> do a few extra things (that it apparently doesn't do out of the box) that can 
> easily been done at the Command level. I understand, though, that using 
> VBScript or executing a .bat file is not considered best practice. So I'm 
> soliciting ideas on how I might perform the following DOS equivalent commands 
> in my installation:
> taskkill /im program.exe /f
> schtasks /end /tn taskname
> del [INSTALLFOLDER]program.exe
> I'd prefer to use C# for the code. Any ideas are welcome. Thanks!
> *I am using a custom DLL, and it's working except for the last point above.
> How do I get access to INSTALLFOLDER from within my C# function? Thanks.*
>
>
>
> --
> View this message in context: 
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Running-DOS-commands-from-installation-tp7594577.html
> Sent from the wix-users mailing list archive at Nabble.com.
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
> &#149; 3 signs your SCM is hindering your productivity &#149; Requirements 
> for releasing software faster &#149; Expert tips and advice for migrating 
> your SCM now http://p.sf.net/sfu/perforce 
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
> &#149; 3 signs your SCM is hindering your productivity
> &#149; Requirements for releasing software faster
> &#149; Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to