views:

49

answers:

4

I'm currently working on my applications installer and I'm wondering where the executable files should be installed to in Windows 7.

If I'm installing as admin my executables files get put in C:\Program Files.

If I install my product as a normal user where should the executables be put?

Thanks in advance.

+2  A: 

Which installer are you using?

MSI runs in elevated privileges. You can install your application in program files folder

ajay_whiz
I'm currently using InnoSetup.What do you mean by 'runs in elevated privileges' - does it require admin authentication to install?
CiscoIPPhone
it wont ask for a admin password. But, just a message to the user that application will run with admin privileges. user has the choice to cancel the execution of the setup
ajay_whiz
Thanks ajay.Does anyone know if InnoSetup is capable of creating an elevated privileges installer?
CiscoIPPhone
@CiscolPPhone if your file name is setup.exe Windows 7 by default runs it in elevated privileges.
ajay_whiz
I'll have to try that out, thanks.
CiscoIPPhone
+1  A: 

Put the files in the user folder.

This will mean that the application is only available to that user.

ChrisF
By user folder do you mean C:\Users\USERNAME\AppData\Roaming\?
CiscoIPPhone
@Ciscol - Not 100% sure as I don't have Windows 7 on this machine to double check, but "C:\Users\USERNAME\AppData\YourApp" would be a good choice.
ChrisF
+1  A: 

You should probably store that in the AppData directry, as I saw you mention in reply to @ChrisF. Remember that the user can move this directory though, so I wouldn't point to it explicitly. There is an environment variable that you can grab, that only applies to the logged-in user, which is %AppData%.

Keep in mind that putting it in %AppData%/Roaming would follow the user across multiple machines on the same Domain and %AppData%/Local would just stay on the one machine.

Serplat
+1  A: 

The executables should be under Program Files, who's precise location may vary from installation to installation. This means that the setup should run elevated. If InnoSetup makes .msi files, they will request elevation. If it makes a file called setup.exe, it will also request elevation. If for some reason the exe has a different name, like GetStarted.exe, then you should hand create an external manifest (GetStarted.exe.manifest) and put in requireAdministrator for the requestedExecutionLevel which will ensure your installer requests elevation.

Regardless of how it requests elevation, if the user doing the install is an admin (eg you) they will just have to click consent. If they are not an admin they will need to get an admin to consent for them. After that the installer will be able to write to Program Files.

If it's important to you that non admins be able to install the app then have the executables go under the users profile - but that would not be my first choice. The protection given to Program Files means that users are less likely to find themselves with messed up copies of your application if you install it to the protected area.

Kate Gregory