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,622 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

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…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

828 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