You can run dot net code during installation, although there are some reason
why you should not. I have been executing .net code in my installation for
quite a while now

Anyways here how to do it :

Include the following

<Binary Id="InstallUtil" SourceFile="$(env.windir
)\Microsoft.NET\Framework\v2.0.50727\InstallUtilLib.dll" />

<Binary Id="MSVBDPCADLL" src="Binary\MSVBDPCADLL.ibd" />

<Binary Id="VSDNETCFG" src="Binary\VSDNETCFG.ibd" />

In a class library project, add a installer class. Check out
http://go.microsoft.com/fwlink/?linkid=83721 for example the msi contains
SetSecurity project, this is used to added custom code.

Now add the following in installexecutesequence


<Custom Action="InstallSetProp" After="StartServices">$HelperLibrary&gt;2</
Custom>

<Custom Action="Install" After="InstallSetProp">$HelperLibrary&gt;2</Custom>
So, once installation starts, it the first CA sets up parameters required
for the .net function we want to call
and the 2nd CA calls the .net function

The CA will be written as follows - change the InstallSetProperty's Value as
required.

<CustomAction Id="Install" BinaryKey="InstallUtil" DllEntry="ManagedInstall"
Execute="deferred" />

<CustomAction Id="InstallSetProp" Property="Install"
Value='/installtype=notransaction
/action=install /LogFile= /solutionCodeGroupName="***"
/solutionCodeGroupDescription=&quot;Code group for ***&quot; /tDir=&quot;
[TARGETDIR]\&quot; /assemblyName="SharedLibrary.dll"
/assemblyCodeGroupName="SL" /assemblyCodeGroupDescription="Code group for
SL" "[#InstallerFile]" "[#ConfigFile]"' />

I hope this helps.
- Nitin

On 4/6/07, Igor Lemsky <[EMAIL PROTECTED]> wrote:

I need to launch some .net code during installation. Which possibilities
do I have? As I hear there are problems with .net custom actions in Windows
Installer.
So I cant add my .net assembly exe into the product as file or binary
stream and use one of the custom actions types to launch it?
Only way to launch from other custom action script like VBS or native dll
(c++)?

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to