Solved

ProjectInstaller: Get installedfolder and other properties at installation

Posted on 2003-11-14
18
491 Views
Last Modified: 2007-12-19
Hi all,

I've built a Windows Service in VB.NET.
Added a projectinstaller and a setup project which creates the MSI and Setup.exe.
This all works fine.

I want to add a form that can be displayed at the end of installation (OnAfterInstall event) in which the user can do some settings.
In this screen I also want to display the folder that the service is installed to.

I can display the form, that's no problem.
But I can't seem to find the "installation properties" like the installation folder (ie: the folder in which the service is installed).

Any ideas?

D'Mzz!
RoverM

Ps: For a complete working example in VB.NET I'll up the points to 500.
0
Comment
Question by:roverm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
18 Comments
 
LVL 9

Expert Comment

by:Joeisanerd
ID: 9752756
Write the installed folder value to the registry, then read that value when you show the form. If you are using the setup project stuff the TARGETDIR is the keyword for the install directory.
0
 
LVL 12

Author Comment

by:roverm
ID: 9763221
Hi,
I am using the 'setup project stuff' but I can't seem to access that from my ProjectInstaller.
Also, I don't want to write to the registry.

Thanks tho.

D'Mzz!
RoverM
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9763873
Installer.ProductInfo("{product code guid}","InstallLocation")
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 12

Author Comment

by:roverm
ID: 9763970
TheLearnedOne:
My installer doesn't provide a 'ProductInfo' prop.

Just to make sure: I am using the ProjectInstaller in my Service Project.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9764069
Sorry, all I focused on was the MSI part.  You can get this property from there.  

You are talking about ServiceInstaller, correct?
0
 
LVL 12

Author Comment

by:roverm
ID: 9764109
What do you mean : "MSI part".
Can I access the MSI from the ProjectInstaller?

ProjectInstaller: Right click on 'Service1' (your service in the designer) and choose 'Add Installer'.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9764156
No.  I just saw the word MSI in your initial comment, and that is the method within the Windows Installer.  

Now that I understand better, AFAIK there isn't any way to get the Installed location from the Installer class.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9764231
Have you looked at the Context property?  It has parameters, and since I haven't used this, I am not quite sure what information it can give you.
0
 
LVL 12

Author Comment

by:roverm
ID: 9764242
*lol*
It must be possible....
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9764262
I usually keep this process pretty simple, so I don't have much experience working outside the box on this one.  I am willing, though, to extend a little further outside my "comfort" zone, and help you find this information, because I agree with you that it should be possible.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9764394
How is your Install process started?  Are you using InstallUtil?
0
 
LVL 12

Author Comment

by:roverm
ID: 9765552
I've added a setup project to the service project.
The setup creates the MSI and a setup.exe.

The installation will be started by double clicking the msi or the setup.exe.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9765721
I always use InstallUtil, so I have to ask, how it the MSI file generated for you?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9765771
I figured a little more out here.  You created a Setup and Deployment project.  Doh!!

Is the ProjectInstaller in the Windows Service project?  In the Setup project, what is the value for the 'Application Folder' setting?
0
 
LVL 12

Author Comment

by:roverm
ID: 9765777
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 total points
ID: 9766696
In the AfterInstall event there is a sender parameter, which is an IDictionary object for the saved state of the computer.  Did you check the settings from that?

Also there is an article at, which talks about adding additional functionality to the Walkthrough you addressed:

Install a Windows service the way YOU want to!
http://www.codeproject.com/useritems/WindowsServiceInstall.asp
0
 
LVL 12

Author Comment

by:roverm
ID: 9911313
Closed the Q, was open long enough.... ;-)
Actually it didn't solve my Q but I put me on 'a certain track'. Hopefully I will be able to read it.

Thanks!
D'Mzz!
RoverM
0
 
LVL 12

Author Comment

by:roverm
ID: 10079820
Found the solution.... wanna know?
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question