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

Reply via email to