-1

I'm updating our installer for Windows 7 (based on Inno Setup). What came into my mind is that if the user does not run the installer with admin permissions, later on the application cannot be launched directly from the installer. So I'd like to enforce him to run the installer with administrator permissions. So how to do it? Should I stop the installation process and tell him to run it with the right permissions? If so - how to identify if he uses admin permissions?

Looking for best practices. Please advice...

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Tamir Gefen
  • 1,128
  • 2
  • 18
  • 35
  • 2
    Why does your application require administrative privileges to *launch*? Best practice is not to do so... – Cody Gray - on strike Dec 28 '11 at 13:31
  • 1
    Same question as @Cody Gray... Can your app onlt be launched as Admin? – Tony Hopkinson Dec 28 '11 at 13:41
  • Thanks. It seems I need admin privileges since: 1) I'm redirecting output to %temp% directory 2) I'm sending output to log file (resides inside the directory where the application is installed) – Tamir Gefen Dec 28 '11 at 14:53
  • 3
    You should definitely not need administrative privileges to write to a temporary directory. What do you mean by "redirecting output"? What output? How are you redirecting it? And yes, you *will* need admin privileges to write to a file in the application's directory, **but you shouldn't be doing that in the first place**. Change the logging code to write to a more appropriate location, such as those [documented here](http://stackoverflow.com/questions/5210575/does-windows-7-have-the-same-problem-as-vista/5210642#5210642). – Cody Gray - on strike Dec 28 '11 at 15:08
  • @Cody Thanks. I'm redirecting stdout and stderr to %temp% directory since I want to prevent OutOfMemory Exception. I'm using VB.NET so I'm redirecting by "psi.arguments = " .... > stdout ..... 2>stderr" Regarding log files, I'm saving it under the installed directory since it's convenient for users (and for me) to read it if necessary. What's the best place to save log files without asking for admin privileges? Is it %localappdata% ? – Tamir Gefen Dec 28 '11 at 16:01

1 Answers1

4
PrivilegesRequired=admin

http://www.jrsoftware.org/ishelp/index.php?topic=setup_privilegesrequired

Kyle Alons
  • 6,955
  • 2
  • 33
  • 28