Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Custom installer VS Setup project builds?


3 replies to this topic

Corvud

Corvud
  • Full Members
  • 2 posts

Posted 08 April 2009 - 18:37

I've been assigned to maintain some old Visual Studio .Net 2003 setup and deployment projects that require a lot of hand-tweaking to build. Each build requires editing the app.config and internal .xml data files for the primary output, building it, building the installer, then adding some properties to the .msi file using Orca. I would like to automate these as much as possible.

My idea is to add something to the Visual Studio Setup project that will edit the primary output files before building the .msi, and adding properties to the .msi after building. I could do that with the primary output by defining pre- and post-build events in VS, but I do not see this option for Setup projects.

Is there any way to invoke Orca or MsiExec from VS to add properties programmatically?

Is there any way to accomplish this with Visual Studio, Orca, or WSH? Failing that, could I add something to the installer itself to update the app.config and .xml data files after installing?

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 09 April 2009 - 08:45

QUOTE (Corvud @ 2009-04-08 17:37)
Is there any way to invoke Orca or MsiExec from VS to add properties programmatically?

Is there any way to accomplish this with Visual Studio, Orca, or WSH?

Use the WindowsInstaller.Installer object. It's fully documented on MSDN, plus the SDK has some sample VBSs which you can use as templates.

If you wanted the whole thing to be hosted in one environment (VBS seems like a good place to me, but then, I have a ton of Installer stuff in VBS), there's a couple of XMl classes knocking about and a component (from ChilKat? Maybe freeware?)
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Corvud

Corvud
  • Full Members
  • 2 posts

Posted 10 April 2009 - 19:27

Thanks VBScab, I will investigate the WindowsInstaller.Installer class and VBScript XML classes. I am unclear, though, on how I am supposed to run these things.

I want to automate my build process in Visual Studio; can I run these scrips as part of my Setup project build? How? I see no pre- or post-build events for VS Setup projects.

When you say "hosted in one environment", do you mean there is a way to edit my support files, build my .Net project, and change installer properties all from some single IDE? I know of no way to do that from Visual Studio .Net 2003.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 14 April 2009 - 08:59

I don't know enough about VS to comment. In referring to a single environment, I was thinking of a VB Script, onto which you would drop the project folder.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.