Question

I have two different windows application projects. I want that at the time of installation both will install together in same folder like one exe is installed.After installation both will work separately.There is an xml file which will be update by one project which have forms and another exe will use it which does not contain any form,just show the notify icon.Is it possible to create a setup file which will install both the exe's together? how do I give the path of the xml file?

Was it helpful?

Solution

You can use SetupProject to do it

Add setup project:

http://msdn.microsoft.com/en-us/library/19x10e5c(v=vs.80).aspx

Add primary outputs of both applications to it

http://msdn.microsoft.com/en-us/library/z11b431t(v=vs.80).aspx

If you want to place your xml file in your installation folder, there are permission issues to resolve if you want to change it later when your applications are running (usually admin privilages are needed), so you can't just add it to your setup project (that will only copy it to your installation path).

But after adding it to your setup project, you can copy your xml file to the location of your choice. Path of the xml file can be set using environment paths, for example Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

You can do it using a separate little console project that contains Installer class, where you copy your file and generally do additional things that need to be done during installation :

http://msdn.microsoft.com/en-us/library/system.configuration.install.installer.aspx

How to pass TARGETDIR into CustomActionsData?

http://www.codeproject.com/Articles/5821/All-about-Installers-Customizing-Windows-and-Web-s

http://msdn.microsoft.com/en-us/library/2w2fhwzz(VS.80).aspx

You can use TARGETDIR to get your installation path in yoour installerr class (just google it or use the link above, it's explained well there)

Then add your installer project's primary output to CustomActions in your SetupProject.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top