Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > MSI Installer Help - Getting the installation directory for later use etc.
 

MSI Installer Help - Getting the installation directory for later use etc.

I'm trying to write what I think is a fairly simple MSI installer using VS2008. I have never written one before, or coded in C#, but I am familiar with C, C++, and Java. I am having a hard time finding information on the web about how to do what I need to do. Could any of you guys point me to a place where I could find more information about what I am trying to do? I would like to be able to do the following:
- make sure the user has Java installed, and start the Java web installer if they decide to
- get the directory that the user chose to install my app
- run a batch file after the files on are on the hard drive to finish installation (I think I know how to do this with a process object)
- run a batch file when the app is uninstalled so that I can clean up the application this would need to be done before the files are removed(I think I know how to do this with a process object)
- get information provided by the user and write it to a file in the installation directory

If any one knows of an easier solution to use that would also work as well. Thanks for all the insight.
theshackler  Sunday, August 30, 2009 4:21 AM
Hi theshackler,

We can create a Setup Project to build a msi package.
This is a walkthrough: http://msdn.microsoft.com/en-us/library/k3bb4tfd(VS.80).aspx.
This is the detail document: http://msdn.microsoft.com/en-us/library/2kt85ked(VS.80).aspx.

Then we can create a customactionto do the jobs you listed.
This is a walkthrough about custom action: http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx.

We canget the installed directory via the prameterTARGETDIR.
This thread shows how to do that in detail: http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/d8c1be8a-a431-4d0c-bdca-01dde8c94b2a.
Please pay attention to the reply of Bruce.Zhou.

Let me know if this helps.
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Tuesday, September 01, 2009 11:01 AM
Hi theshackler,

We can create a Setup Project to build a msi package.
This is a walkthrough: http://msdn.microsoft.com/en-us/library/k3bb4tfd(VS.80).aspx.
This is the detail document: http://msdn.microsoft.com/en-us/library/2kt85ked(VS.80).aspx.

Then we can create a customactionto do the jobs you listed.
This is a walkthrough about custom action: http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx.

We canget the installed directory via the prameterTARGETDIR.
This thread shows how to do that in detail: http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/d8c1be8a-a431-4d0c-bdca-01dde8c94b2a.
Please pay attention to the reply of Bruce.Zhou.

Let me know if this helps.
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Tuesday, September 01, 2009 11:01 AM

You can use google to search for other answers

Custom Search

More Threads

• ClickOnce on a Citrix server with roaming profiles
• I don't understand how stop my installer Class on Cancel_Button Clicking
• EXE updates itself on version change - Is possible?
• Help!! Same app and ClickOnce version installs twice!?
• what is the used of .InstallState
• ClickOnce package file deletion
• Manifest Error with COM DLLs
• Can i Install my program with 'One Click'??
• Including an Excel spreadsheet in a C# Express WinForms application install...
• Create Localized MSI using Setup and Deployment project in Visual Studio 2008