Rob and Brett, thanks for the clarification.  The class that my
colleague wrote does include uninstall and rollback functions so I plan
to integrate those as well.  Perhaps, in the long run I will look to
convert to the WiX extensions.  Thanks all

-----Original Message-----
From: Brett Kapilik [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 11, 2007 1:03 PM
To: Rob Mensching; Alex Steen; wix-users@lists.sourceforge.net
Subject: RE: [WiX-users] Custom Action that references C# classes?

Rob makes some good points below. In the long run you are much better
off using the WiX extensions to do that stuff because they support
rollback, uninstall, etc. properly. If you want to use your own custom
action and do things properly, you should make your executable/DLL
support different actions based on a command line argument such as
"-UNINSTALL", "-ROLLBACK", etc. and then create multiple "Custom"
entries with the appropriate conditions and command line arguments on
them.

I just wanted to let you know how it was done - please do not interpret
it as a best practice recommendation.

- Brett

> -----Original Message-----
> From: Rob Mensching [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, April 11, 2007 1:00 PM
> To: Alex Steen; Brett Kapilik; wix-users@lists.sourceforge.net
> Subject: RE: [WiX-users] Custom Action that references C# classes?
> 
> The problem with this method is that you will have a very 
> difficult time participating in the reference counting and 
> transaction when applying changes to the machine.
> 
> Scheduling after InstallFinalize also likely won't work 
> because your install is not elevated at that point in time.
> 
> Really, there is a significant amount of work necessary to 
> correctly install resources on a machine and have it work for 
> install/uninstall/repair/upgrade/patching.
> 
> Oh, you also don't need a "1" in the <Custom/> element.  An 
> empty condition means to run the action all the time.
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Alex Steen
> Sent: Wednesday, April 11, 2007 10:55 AM
> To: Brett Kapilik; wix-users@lists.sourceforge.net
> Subject: Re: [WiX-users] Custom Action that references C# classes?
> 
> That's exactly what I was looking for, Brett, thank you.  One 
> extra question, is it possible to get arguments through my UI 
> and pass them to my CustomAction as arguments to the script?
> 
> -----Original Message-----
> From: Brett Kapilik [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 11, 2007 12:43 PM
> To: Alex Steen; wix-users@lists.sourceforge.net
> Subject: RE: [WiX-users] Custom Action that references C# classes?
> 
> You can certainly do that. You should include both the C# dll 
> and the executable that calls it in your installer. Then make 
> a CustomAction element that defines the custom action. Make 
> sure to use the FileKey attribute to reference the 
> executable's file ID (i.e "Myfile.exe") as well as any of the 
> other attributes that apply:
> 
> <CustomAction Id="SetupDatabase" Impersonate="yes" Return="check"
> Execute="immediate" FileKey="Myfile.exe" ExeCommand=""/>
> 
> Then create a Custom element that schedules the custom action 
> to happen after the files are installed:
> 
> <InstallExecuteSequence>
> <Custom Action="SetupDatabase" After="InstallFinalize">1</Custom>
> </InstallExecuteSequence>
> 
> (I am not 100% sure about the After="InstallFinalize" - 
> perhaps someone else has a reccomendation on where to 
> schedule the action).
> 
> Hopefully that helps get you on your way.
> 
> - Brett
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of JCWrs
> > Sent: Wednesday, April 11, 2007 12:29 PM
> > To: wix-users@lists.sourceforge.net
> > Subject: [WiX-users] Custom Action that references C# classes?
> >
> >
> > One of our developers has written a class that is able to 
> set-up all 
> > of the virtual directories, websites and IIS that our app 
> requires.  
> > Is there a way to write a custom action that executes a file that 
> > calls functions from this C#.Net class?
> >
> > I realize that I can call pre-defined Custom Actions to 
> set-up all of 
> > this using certain wixlib's, but I'm trying to avoid doing so if 
> > possible (why re-write it all when its already done?).
> > --
> > View this message in context:
> > http://www.nabble.com/Custom-Action-that-references-C--classes
> --tf3560476.html#a9943333
> > Sent from the wix-users mailing list archive at Nabble.com.
> >
> >
> > --------------------------------------------------------------
> > -----------
> > 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
> 

-------------------------------------------------------------------------
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