Solved

How to install windows service on windows 7 and vista by disabling user account control or some other way

Posted on 2010-09-08
9
1,624 Views
Last Modified: 2013-11-27
Hey guys..

I really need your help in the my problem.

I developed a windows service based on .net framework 2.0. Till now I tested it on windows XP. Now it is ready to go to production. So eventually I need to test it on other windows versions also right. So I tried to test on windows 7.

I use batch file to execute my installation files(.exe, .dll etc). So when try it on windows 7, it is not allowing me to install. The error I am getting is:

Access to the path C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.InstallLog is denied

The problem I figured is User Account Control. How can I add my application as an exception to user account control or what is the other way to do it.

I guess I am going to face same kind of problem in windows vista also.

I developed my windows service in C# using .NET Framework 2.0

I really need it as soon as possible. Thanks guys for your help.

Rakhy...
0
Comment
Question by:rakhy_rakey
  • 3
  • 2
  • 2
9 Comments
 
LVL 3

Expert Comment

by:berniep
ID: 33632994
There's quite a good write-up on UAC here:
http://technet.microsoft.com/en-us/library/cc709691(WS.10).aspx

But I don't think it will allow you to automate your install.  Can you automate changing the directory permissions to everyone/full control for that log file?
0
 

Author Comment

by:rakhy_rakey
ID: 33633233
Thanks for the reply...I will try to change the directory permissions.
0
 
LVL 10

Accepted Solution

by:
joriszwaenepoel earned 250 total points
ID: 33633889
Have you tried to run your batch file with "Run As Administrator"?  It has worked for me on a Windows Server 2008, I haven't tried it on a Windows 7.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:berniep
berniep earned 250 total points
ID: 33634106
or using the command line "runas" :

C:\>runas
RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
        /user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
        /smartcard [/user:<UserName>] program

RUNAS /trustlevel:<TrustLevel> program

   /noprofile        specifies that the user's profile should not be loaded.
                     This causes the application to load more quickly, but
                     can cause some applications to malfunction.
   /profile          specifies that the user's profile should be loaded.
                     This is the default.
   /env              to use current environment instead of user's.
   /netonly          use if the credentials specified are for remote
                     access only.
   /savecred         to use credentials previously saved by the user.
                     This option is not available on Windows Vista Home or Windows Vista Starter Editions
                     and will be ignored.
   /smartcard        use if the credentials are to be supplied from a
                     smartcard.
   /user             <UserName> should be in form USER@DOMAIN or DOMAIN\USER
   /showtrustlevels  displays the trust levels that can be used as arguments
                     to /trustlevel.
   /trustlevel       <Level> should be one of levels enumerated
                     in /showtrustlevels.
   program         command line for EXE.  See below for examples

Examples:
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

NOTE:  Enter user's password only when prompted.
NOTE:  /profile is not compatible with /netonly.
NOTE:  /savecred is not compatible with /smartcard.

Except that I find it needs a password:

C:\>runas /user:administrator cmd
Enter the password for administrator:
Attempting to start cmd as user "BERNIEP\administrator" ...
0
 

Author Comment

by:rakhy_rakey
ID: 33754496
hey I got the answer for this one.

I use microsoft visual studio to build msi set up file. And I used commands to for silent installation. It worked fine in vista and 7. But all we need to do is, we need administrative previleges.

Thanks guys for help..

Rakhy...
0
 
LVL 10

Expert Comment

by:joriszwaenepoel
ID: 33760568
You tell all you need is administrative privileges.
Maybe you could accept my pervious comment as the answer, instead of just closing the question.
0
 
LVL 3

Expert Comment

by:berniep
ID: 33774721
Hi there, I would think that both my comments provided some help to the solution:
http:#a33632994
http:#a33634106
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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