Solved

Install Service created in VB.NET - InstallUtil.exe

Posted on 2009-03-31
11
2,923 Views
Last Modified: 2012-06-27
Hi - I have created a service in VB.NET (as described here:http://www.devarticles.com/c/a/VB.Net/Creating-A-Windows-Service-in-VB.NET/1/) and I am now planning the deployment. With regards to this I have a few questions and it would be very good if someone with experience in this area could please give me some advise.

1) I have developed the app in Visual Studio 9 (.NET 3.5) When I go to find the tool InstallUtil.exe I find this in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 however the tool is not present in C:\WINDOWS\Microsoft.NET\Framework\v3.5. Is there a new recommended way for deploying services in 3.5?

2) If I am to install the service on the client machines using InstallUtil.exe I guess I have to manually install .NET prior to installing the service. I guess this is a matter of downloading the framework from http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en and installing it? Anything else I need to consider? Will InstallUtil.exe be a part of this package or do I have to install .NET V2 first?

3) I do not have much experience installing apps on VISTA. Will the procedure be the same on this OS, I.e using InstallUtil.exe etc?

Thanks J
0
Comment
Question by:jes12345
  • 6
  • 5
11 Comments
 
LVL 12

Expert Comment

by:rgn2121
ID: 24026632
I have never installed anything on Vista, so if I am way off here then just disregard.  I am curious why you don't just add a Setup and Deployment project to your solution and then create the Setup file to run on your Client(s).  You can add that the .Net versions be checked and installed as prereqs...
0
 

Author Comment

by:jes12345
ID: 24026654
Hi - its a good point. I guess I can first run a setup and deployment project to get all the files in place then do the manual steps using InstallUtil.exe to get the service set up.
Does this sound like a good strategy? I guess some of my questions still remain - why is this only in V2 not in V3.5 etc.-

Thanks J
0
 
LVL 12

Expert Comment

by:rgn2121
ID: 24026668
I followed something similar to this for a service I installed on an XP system.  I was only installing it on one pc, so I knew the framework that was present, but You could slick on your setup and deployment projects and click properties and then prereqs and there you will see a list of things you can add as a prereq.

http://msdn.microsoft.com/en-us/library/ms227381.aspx
0
 
LVL 12

Expert Comment

by:rgn2121
ID: 24026682
I would guess that it is only in .Net 2.0 and not 3.5 because it hasn't changed.  They probably figured, "Why add something to 3.5, that hasn't changed...they can use the tool in 2.0".

I am not sure what you mean by "Manual Steps', but I created the project and then ran the install...ALl setup and ready to go.
0
 

Author Comment

by:jes12345
ID: 24026922
Hi - thanks for the links. However this brings up a few new questions.
1) In the link you gave it says(http://msdn.microsoft.com/en-us/library/ms227342.aspx):

 Note - Always ensure that the target computer already has the .NET Framework installed.
I thought installing the .NET framwork was the purpose of the setup process you recommended?
2) It also says: Change the Solution Configuration to Release.
How do I do this?

Thanks J
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 12

Expert Comment

by:rgn2121
ID: 24027102
1). It isn't necessarily the purpose, but it is what I am familiar with and I know you can select your prereqs and check to make sure certain things are installed before continuing.

2)You can do this by right clicking your project and going to Properties>Compile
Or you can left click your project to select it and at the top in the middle of the window you will see something like the screen below..either way click the drop down that says debug and click Release.


sample.png
0
 

Author Comment

by:jes12345
ID: 24027158
Hi - thanks again for the reply.

Final questions regarding the framework for clarification. If I install .NET 3.5 the V.2 will be installed as well right (i.e the InstallUtil.exe will be installed). Also if I create an installer and run it on a client machine and the .NET framework is missing then the setup will assist with downloading the framework right?

Finally I am still not clear on how to change the release setting. I do not have the same UI as you.. Please see the screenshots for the options I have.
ScreenHunter-01-Mar.-31-11.51.jpg
ScreenHunter-02-Mar.-31-11.51.jpg
0
 
LVL 12

Expert Comment

by:rgn2121
ID: 24035775
Yours looks to be set for Release already...identified by the bin/release in your second screenshot.  If I was installing on a box that needed both then I would make sure that I checked both under the prereqs...  What I am on right now only has the .Net 2.0 listed, but I am sure my 2008 at home would be different.  If you want to wait till I can give screen shots of that then I can do it tomorrow.

As to your first question... I am not sure that if you specifiy 3.5 that it will add 2.0 becase that is a prereq for 3.5.  I would think, but I am away from my 2008 box, that you would select both .Net 2.0 and .Net 3.5.  That way it will check for both and install accordingly.  I can't really be much more specific since I can't look at it right now and tell you exactly what to do.
0
 

Author Comment

by:jes12345
ID: 24036608
Hi - again thanks for your reply. You are probably right in that I should set both 2.0 and 3.5 as a prereq and I will go for that strategy.

However I am still a bit confused with regards to Debug/Release. As you probably understand by now VB and .NET is fairly new to me since I have been a Java developer for many years. Therefore I am wondering what is really the difference between the two modes and is it possible to show a toolbar so that I can display the dropdown as you do? What version of visual studio are you on?

Thanks J
0
 
LVL 12

Accepted Solution

by:
rgn2121 earned 500 total points
ID: 24043283
I use VS 2005 at work...VS 2008 at home, both Professional versions.  What version are you using?  On my 2008 box I can right click the toolbar at the top and select the standard toolbar.  I would think this is what is set as default, so I am curious if you are using an express edition?

I created a setup project today and looked at the default prereqs and 3.5 is selected.  You have the option to select 2.0 and 3.0, but without doing it I am not sure if you need to select all that apply.  If that is the case you will need to add launch conditions that is discussed in the following link.  Very simple to do...
http://msdn.microsoft.com/en-us/library/s1t32hs9.aspx
The notes section at the bottom talks about conditions for .Net Framework.

You can make it so the Framework is installed with your app and not downloaded from the web by adding the redistributables to your setup so if the user doesn't have internet access they can still update their framework.

As to Debug/Release...Debug builds contain extra info in the build for debugging etc.  Release builds do not and the code is optimized to be smaller and run faster.  This may cause what are known as release bugs.  Ones that only show during the release build.
 
0
 

Author Comment

by:jes12345
ID: 24050067
Hi -  I am using VS 2008 Pro but the toolbar is different(?) However I was able to find the setting under Build->Configuration Manager

Thanks for the links and all your advises. I blieve I have all the info I need now and will be creating the final installer over easter. So I will credit you the poinst now and I hope it is ok with you if I raise another question should I be stuck when I get back to creating the installation procedure.
Thanks-J  
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now