Archive: simple installer problems


simple installer problems
Hey guys, I have made an installer for a little app and deployed it to users. It works great for me on Win7 x64, where UAC is disabled and I'm admin. However, I'm getting reports that running it does nothing on Win7 x64. Other users say they have to run it with admin privileges.

Can someone please take a quick look at my installer and tell me if I need to add anything to make it work with different Windows security configurations, etc? Here it is:
http://paste2.org/p/3021946

Also I should note that (after installation) when my app runs it needs to be able to write files to the installation directory. Will this be a problem if someone installs it to Program Files as a user that isn't an admin? It is really important that my app do this, I can't just change it to write in the user directory. Will I have to have my app always run as admin? How do I do that?

I hate to have to ask for help, but it really isn't clear to me what I need to do for various Windows setups and I can't possibly test them all myself. Thanks in advance! :)


You can use the access control plugin but it is not a good idea!

InstallDir "$PROGRAMFILES\Spine"
InstallDirRegKey HKCU "Software\Spine" ""
RequestExecutionLevel user

Those 3 lines are a problem, use "RequestExecutionLevel admin"+HKLM+$PROGRAMFILES OR "RequestExecutionLevel user"+HKCU+$LocalAppData\Programs


I don't understand your suggestion. This syntax doesn't compile:
"RequestExecutionLevel admin"+$PROGRAMFILES

I only use HKCU, so I don't think I need HKLM. Ooooh! I just noticed I had "user" and not "admin"! That should help!

What about when my program runs? Can it write to Program Files just fine? If not, what can I do?

Should I change the default installation from Program Files to something else, like $LocalAppData\Programs? This seems weird, as I think Program Files is the default for all installers I've ever seen.

Edit: why is the access control plugin a bad idea?


Should I change the default installation from Program Files to something else, like $LocalAppData\Programs? This seems weird, as I think Program Files is the default for all installers I've ever seen.

Edit: why is the access control plugin a bad idea?
It depends... Why your app needs to write to your installdir? Config files? Logs?

For unterstanding: Such things like Logs and settings should not be written to $Programfiles because this is a protected folder. You could normally write to it with admin rights only. This is the folder for the program itself. installed by admin and readable/executable for users. Stuff like Settings Logs (generated and used by the user) etc. should be stored to %localappdata% or %appdata%. They are intended for userdata.
Under XP 99% of all users had admin rights. So many programmers did not pay attention because it worked anyway. That was the reason for most Compatibility issues of the programs later at the beginning of Windows Vista.

So there are 3 ways to fix that:
The lazy way: Dont install to $programfiles. Install to $LocalAppData. You dont have to redesign your app.
The right way as mentioned by Microsoft: Redesign your app. Seperate programfiles and userdata.
The dirty hack (not recomended as Anders said): grant write access for users to $PROGRAMFILES\Spine with access control plugin. But this is a bad idea because malware can now easily modify your exe and dll files to do bad stuff.

Now it´s your choice ;)