Opened 11 years ago

Last modified 5 years ago

#1837 new defect

Windows installer installs under user home dir

Reported by: fabio Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords: windows
Cc: Patch:

Description (last modified by Silier)

Tried 0ad alpha 12 installer on a friend machine, it defaults to C:\Users\username\AppData\Local\0 A.D. alpha\ even if installing from ad Admin account.

It should install for all users in standard program directory.

Possibly the spaces in the directory name "0 A.D. alpha" should be removed.

Change History (17)

comment:1 by historic_bruno, 11 years ago

Couldn't you run the installer as admin and choose somewhere in C:\Program Files? I think that's preferable to requiring elevated permission to launch the installer (unless NSIS has a way to request elevation only when needed...)

Or we could do what other installers do and offer two options: "Install for all users" and "Install for only this user". Then it won't really matter where it ends up, as long as it does what it says. I don't know if NSIS supports that either. Lots of installers assume Program Files but it's not a requirement.

comment:2 by dbolton, 11 years ago

NSIS certainly supports installing to C:\Program Files. 0 A.D. is the only instance of NSIS that I've come across that doesn't install in the Program Files by default.

I couldn't find 0 A.D.'s NSIS script after a cursory look through the public SVN, so I can't offer any specific suggestions, but here's a sample script that may be a helpful model: http://nsis.sourceforge.net/A_simple_installer_with_start_menu_shortcut_and_uninstaller

Although you can "install" a program to any location on Windows, it is helpful to follow common conventions.

comment:3 by fabio, 11 years ago

The NSIS script is here: source/tools/dist/0ad.nsi

Last edited 11 years ago by historic_bruno (previous) (diff)

in reply to:  2 comment:4 by historic_bruno, 11 years ago

Replying to dbolton:

NSIS certainly supports installing to C:\Program Files. 0 A.D. is the only instance of NSIS that I've come across that doesn't install in the Program Files by default.

The question is whether NSIS supports that without requiring elevated permission to even launch the installer, which I believe was always the argument against defaulting to Program Files. Does it know whether the chosen install location requires permission to be granted for the current user?

I think the convention on Windows is to not care much about user account management or security and just run everything as an administrator (though in Vista+ you still need to pass UAC), and not worry about limited accounts being unable to install software without enter an admin's password, and to dump everything in a system-wide location without even considering per-user installations. Which all seems like a terrible convention to me, I'm OK with breaking from it :)

Last edited 11 years ago by historic_bruno (previous) (diff)

comment:5 by dbolton, 11 years ago

I frequently see software projects offer two downloads: an installer (that requires UAC) and (a less prominent) zip file that can be decompressed anywhere you want on your computer.

If you prefer to offer this ability from a single installer, here's an NSIS script that offers both user-level access and administrator-level access: http://nsis.sourceforge.net/UAC_plug-in

Note: the current install script doesn't let the user install to the Program Files folder even if the user wants to.

comment:6 by fabio, 11 years ago

Could you provide a patch to the 0ad installer?

in reply to:  5 comment:7 by historic_bruno, 11 years ago

I wouldn't mind having a separate portable installer, but it would require slightly more work during packaging.

Replying to dbolton:

Note: the current install script doesn't let the user install to the Program Files folder even if the user wants to.

Sure it does, it's Windows that doesn't let you ;) Just right-click the installer and choose run as administrator (we could always mention this on the download/install page) then you can install it anywhere you want and it works perfectly. I still think most people (rightfully) don't care where the game ends up other than maybe which drive it's on. They shouldn't need to go looking for the files.

comment:8 by historic_bruno, 11 years ago

Actually even if you install the game as an administrator, the uninstaller won't have that permission, so it will silently fail on files it doesn't have permission to delete, but will still remove the registry and start menu stuff. That's annoying misbehavior, I guess it does need a proper solution.

comment:9 by Markus, 11 years ago

Keywords: windows added

comment:10 by Silier, 7 years ago

Description: modified (diff)

This ticket can be closed. OS : windows successfully changed installation folder successfully uninstalled : removed all files from folder

Last edited 7 years ago by Silier (previous) (diff)

comment:11 by elexis, 7 years ago

I don't know whether there was a commit that fixed it or whether it has always worked for most people:

https://trac.wildfiregames.com/browser/ps/trunk/source/tools/dist/0ad.nsi?order=name https://trac.wildfiregames.com/log/ps/trunk/source/tools/dist/0ad.nsi

Perhaps it could also explain some installation and directory read problems by some users. Some windows people should confirm Angens observation.

in reply to:  10 ; comment:12 by Silier, 7 years ago

Replying to Angen:

This ticket can be closed. OS : windows successfully changed installation folder successfully uninstalled : removed all files from folder

Update: Windows10: installation on D:\some_folder\... Ok Windows10: installation on C:\ PROGRAMFILES Failed ( Windows 7 ok)

Last edited 7 years ago by Silier (previous) (diff)

in reply to:  12 ; comment:13 by Vladislav Belov, 7 years ago

Replying to Angen:

Update:
Windows10: installation on D:\some_folder\... Ok
Windows10: installation on C:\ PROGRAMFILES Failed ( Windows 7 ok)

Do your user (which you've logon) have rights to install in the ${Program Files} folder?

Last edited 7 years ago by Vladislav Belov (previous) (diff)

in reply to:  13 ; comment:14 by Silier, 7 years ago

Replying to Vladislav Belov:

Replying to Angen:

Update:
Windows10: installation on D:\some_folder\... Ok
Windows10: installation on C:\ PROGRAMFILES Failed ( Windows 7 ok)

Do your user (which you've logon) have rights to install in the ${Program Files} folder?

I have installed there many applications so I think I should have.

in reply to:  14 comment:15 by Vladislav Belov, 7 years ago

Replying to Angen:

I have installed there many applications so I think I should have.

Ok, so it wasn't installed or installed incorrectly? Or wasn't unistalled?

comment:16 by Silier, 7 years ago

It wasnt installed at all in Win10 C:\ProgramFilles Now I am trying to overcome this

Last edited 7 years ago by Silier (previous) (diff)

in reply to:  16 comment:17 by Vladislav Belov, 5 years ago

Replying to Angen:

It wasnt installed at all in Win10 C:\ProgramFilles Now I am trying to overcome this

Did the installer print an error?

Note: See TracTickets for help on using tickets.