Reputation: 17293
Let me explain my situation. I need to distribute a Windows installation package (.msi type) via my web application (written with C# for ASP NET) but I need to dynamically change that .msi package from my web app before it's downloaded. Namely, the msi package adds certains values into the Windows registry during installation, so I need to set those values from my web app.
Is such possible and if so, how would I do that?
Upvotes: 0
Views: 541
Reputation: 986
Your application can edit .msi file directly using e.g. DTF library shipped with WIX (http://wix.codeplex.com). You can parametrize existing registry stuff by using properties and changing their default values in Property table or simply add new rows to Registry table.
Anyway - to do such thing you need some knowledge about Windows Installer and installer databases (.msi files). All common tables are documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa368259(v=VS.85).aspx
Upvotes: 1
Reputation: 44931
That sounds pretty tricky. I have never tried updating an MSI on the fly, but what we do in a similar situation is include the changeable information (such as config files) as uncompressed files next to the MSI, then update them and zip everything into a self-extracting executable which is then delivered to the requestor.
It's not too slow, but I wouldn't try to use it with 10,000 downloads a day.
Upvotes: 1
Reputation: 13335
I'm shooting from the hip here, but how about putting together a setup project with a resource file. Have the MSI project read the resource file for the registry values. Write something that writes the/inserts into the resource file and calls MSBuild (via Process class) to build the MSI as required.
I'm almost certain this wouldn't scale but might be a solution for you?
Upvotes: 1