3

I'm following this tutorial for customizing a web setup project. http://msdn.microsoft.com/en-us/library/aa289522(VS.71).aspx However, I'm working with a web application I already have in visual studio. So part of their solution is to create an installer class in my own web project. When i choose "add new item" I actually don't see the "Installer Class" option in the dialog.
So, I added my own class, referenced "System.Configuration.Install" and extended the .net installer class. My problem is, in the web setup project, my own installer, which, per the instructions in the link above, should actually be invoked, is not being invoked.

Any ideas on what I'm doing incorrectly?

Irwin
  • 12,551
  • 11
  • 67
  • 97

1 Answers1

5

You need to have a [RunInstaller(true)] attribute on the installer, and the .NET installer needs to be triggered as part of the install process, either by a custom installer step in your vdproj installer (see the Custom Actions tab), or by using installutil.

One quick and dirty sanity check is to add a MessageBox to your installer to see if its running (getting logging working correctly is worth understanding though or you're also asking for a world of pain)

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
  • @Lamps: Happy to hear it - you can't beat printfs and MessageBoxes will outlive the cockroaches. Just remember to generally extract 'while I figure it out' stuff like that in a method with a `[Conditional("DEBUG")]` attribute so it can't ever slip into production as in http://stackoverflow.com/questions/3477364/c-conditional-debug-does-it-still-compile-into-release-code. (Though an installer system with a TDD story would beat the whole MSI pain!) – Ruben Bartelink Jan 11 '12 at 07:30
  • If I could I would give you +10. I would never have found out about the "Triggered..." part. I was SURE, this would happen automatically. Thanks for letting me know better. – Marcel Feb 29 '12 at 13:39
  • @Marcel: Glad the internet helped you! If you read up on managed installers and Wix and stuff you'll pretty soon see that Managed Installers are considered poor stepchildren and it'd stop surprising you that they don't get called by default... The Installer team would prefer if everything was declarative MSI actions top to bottom - nice for them not to have to live in the real world! – Ruben Bartelink Feb 29 '12 at 14:52
  • @RubenBartelink I ended up creating a batch file that the user first executes, (installing my prerequisites, actually the Java Runtime) then invokes the setup.exe of my .NET application. – Marcel Mar 01 '12 at 09:45