The Widelands installer should ask for admin privileges when installed into C:\Programs

Bug #1630110 reported by Kyromaster
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

I installed the appveyor generated build 1228 on my computer.
However when starting it I see "the application has requested the Runtime to terminate in an unusual way".
I tried both debug and release builds but I get the same message.
I've a Lenovo MIIX 300 Netbook with Windows 10 x32 and an Intel HD Graphics (Bay Trail).
What can I do to help debugging?

Tags: windows

Related branches

Revision history for this message
SirVer (sirver) wrote :

Thanks for reporting this!

Which OS is this?

I assume this is a duplication of https://bugs.launchpad.net/widelands/+bug/1536377 which remains a mystery for the moment.

Next to widelands.exe should be the output of the whole program (called stdout.txt IIRC). Could you look at its contents? Also, starting widelands from the cmd.exe prompt will give you more information.

Changed in widelands:
status: New → Incomplete
Revision history for this message
Kyromaster (kyromaster) wrote :

I use windows 10
I figured it out: it's related to administrator privilegies
Running widelands.exe as administrator and it works. But no idea why it requires admin rights...

Revision history for this message
SirVer (sirver) wrote :

does this also happen with tinos nightlies?
https://widelands.8-schuss.de/

Revision history for this message
Kyromaster (kyromaster) wrote :

I can't test since these are x64 and I'm on x86

Revision history for this message
Tino (tino79) wrote :

This is a known restriction:
Widelands does not need administrator privilegies and so the installer does not ask for them and suggests an installation dir which does not require elevated rights.

If you explicitely start the installer with elevated rights and install to a restricted path (e.g. c:\Program Files) you also need to run widelands with elevated rights because it writes a logfile at runtime to the same dir as the executable resides in.

Revision history for this message
Kyromaster (kyromaster) wrote :

This isn't true with my system.
It wants to install into "C:\Programme\Widelands" which is IMHO the right place for programs.

Tino (tino79)
Changed in widelands:
status: Incomplete → Confirmed
milestone: none → build20-rc1
Revision history for this message
Tino (tino79) wrote :

You are partly right. This is the correct dir to install programs, but not to write data at runtime to.
What widelands does at moment (the logfile).

I do want to enable users with no admin rights to be able to install and play widelands, so I won't hardcode asking for privileges into the installer.

But for B20 we should do:
- Ask for admin privileges if the user chooses a dir which requires those (but only then)
- Do not write the logfile to wl binary dir (This should go to %USERHOME%\.widelands)

Revision history for this message
Kyromaster (kyromaster) wrote :

This is exactly what I wanted to suppose as a solution ;)
Perhaps even better under windows would be to store all application data to %userhome%\AppData\...

GunChleoc (gunchleoc)
tags: added: windows
GunChleoc (gunchleoc)
summary: - Widelands crashes on startup
+ Widelands crashes on startup when installed into C:\Programs
GunChleoc (gunchleoc)
Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
status: Confirmed → In Progress
Revision history for this message
GunChleoc (gunchleoc) wrote : Re: Widelands crashes on startup when installed into C:\Programs

I have tested the AppVeyor release build for the attached branch on Windows 10. The installer had to be run as administrator when installed into C:\Program Files, the game can then be run without admin privileges. stdout.txt is written to C:\Users\<username>\.widelands

Also, the uninstaller can remove the Widelands directory cleanly now, because there is no new file written into it.

Changed in widelands:
assignee: GunChleoc (gunchleoc) → Tino (tino79)
status: In Progress → Triaged
summary: - Widelands crashes on startup when installed into C:\Programs
+ The Widelands installer should ask for admin privileges when installed
+ into C:\Programs
Tino (tino79)
Changed in widelands:
status: Triaged → Fix Committed
assignee: Tino (tino79) → nobody
Revision history for this message
Tino (tino79) wrote :

Innosetup does not provide a way dynamically asking for admin priviliges when the user chooses a protected installation dir (e.g. C:\Program Files).

I have no switched to {localappdata}\Widelands as default dir, which is guaranteed to be user writable.

If the user does want to install to protected dir, he has to start the installer manually as admin.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.