I started a Windows Forms project that in essence it will download several Zip files, un-compress them and run the installer .msi plus it had to be able to ask SQL connection values to be replaced in the Web Site that creates in one of the installer
For example:
- Download a Web Proeject installer from
http://domain.com/apps/site.zipand install it - Download MS Charts from
http://domain.com/apps/mscharts.zipand install it - Ask Server, Database, Username and Password and replace the
web.config
This is what I’m trying to do, I know I can use DotNetInstaller or even Wix for this, but both projects are huge and the learning curve is high, so I created my own Installer.
My question is, after I run the Process to install the web setup (a msi that Visual Studio created), how can I get the Full Path of where the user choose to install the site?
This is needed to find out where is the web.config file in order to correctly append the new SQL Server connection values.
The site.msi only returns an integer value using int returnCode = process.ExitCode; never the output path ..
Just thinking out loud
I probably can create a Custom Function on the site.msi to write some value into to Registry and then I can safely read on my custom installer … is this a viable option?
What can I do in such environment?
You could use WMI to search for the MSI installer web.config component of your setup:
First you have to identify the component GUID for your web.config component. Open your MSI installer package by using the Microsoft Orca tool (you will find the
Orca tool in the Windows 7 SDK).
Navigate to the File table. Search for web.config in
the FileName column. Remember the ID for the web.config component in the Component_ column.
Then navigate to the Component table. Search for your component with the ID found in the file’s table.
Copy the GUID found in the ComponentId column. This is the component GUID for your
web.config file.
Now, use the determined Component GUID in the following code:
By the same token, creating a custom installer action to write the install path to the registry
is also a good idea!
Hope, this helps.