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,602 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
Comment Utility
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
Comment Utility
Thanks for the reply...I will try to change the directory permissions.
0
 
LVL 10

Accepted Solution

by:
joriszwaenepoel earned 250 total points
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 3

Assisted Solution

by:berniep
berniep earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Hi there, I would think that both my comments provided some help to the solution:
http:#a33632994
http:#a33634106
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

14 Experts available now in Live!

Get 1:1 Help Now