Closed Bug 716492 Opened 13 years ago Closed 7 years ago

Maintenance service does not get installed if the user has write access to their installation directory.

Categories

(Toolkit :: Application Update, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: steffen.wilberg, Unassigned)

References

Details

I've updated the second machine to the latest Nightly today, but the maintenance service was not installed.

The app dir contains maintenanceservice.exe, but the "Use a background 
service to install updates" checkbox in Options-Advanced-Update is hidden.

I'm on Windows 7 64bit, running the 32bit Nightly (mozilla-central, not UX branch etc.; about:buildconfig says: Built from http://hg.mozilla.org/mozilla-central/rev/cf8c9f9aeefc. Build ID is Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120108 Firefox/12.0a1)

I'm running as an admin. I've granted my windows account full access to the Nightly app dir to prevent UAC prompts long ago.

I didn't uninstall a previous build which already contained the Maintenance Service.
In regedit, the key HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla is not present.

"sc query MozillaMaintenance" says:
[SC] EnumQueryServicesStatus:OpenService FEHLER 1060:
Der angegebene Dienst ist kein installierter Dienst.
(The specified service does not exist as an installed service.)
So this means the upgrade is not installing the maintenanceservice_installer.exe installer
The maintenanceservice_installer.exe installer is only executed via update on the following conditions:

1. The user is an admin (part of the administrators group, note not the same as power users)
2. The user has write access into HKLM
3. The user has at least Windows XP
4. HKLM Software\Mozilla\MaintenanceService w/ value Attempted does not exist in the registry

I assume all of these conditions are true for you. 
Is there something specific about your setup you can think of?  

If there's a bug specific to one of the 4 checks above it is most likely #1. Perhaps you have domain admin or something like that and the check is only for admin maybe? (It uses an NSIS plugin to do this check).  We could perhaps remove the check for IsAdmin and rely only on if the user has write access to HKLM.

I think you mentioned you can reproduce this on more than one machine.  Could you try installing maintenanceservice_installer.exe on one of the 2 machines and see if it gets installed?
So, if Steffen is running as admin with UAC turned on and has granted write access to the install directory to get around the UAC then the updater won't elevate and be able to install the maintenance service in post update. If this is the case I think it is an edgecase we should try to work around at least for the initial release if ever.
> I'm running as an admin. I've granted my windows account full access to the
> Nightly app dir to prevent UAC prompts long ago.

That sounds like the most likely reason, thanks for the info Rob. 

Could you try to reset the permissions on that folder and verify that the update installs the service and works going forward?
(In reply to Brian R. Bondy [:bbondy] from comment #1)
> Perhaps you have domain admin or something like that and the check is only
> for admin maybe? (It uses an NSIS plugin to do this check). 
My windows account is an ordinary admin, no domain, not a "power user".

> I think you mentioned you can reproduce this on more than one machine. 
> Could you try installing maintenanceservice_installer.exe on one of the 2
> machines and see if it gets installed?
I ran maintenanceservice_installer.exe from an ordinary, non-admin command prompt, while Nightly was running. The UAC prompt popped up, I granted access, and it succeeded:

It added the following key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\MaintenanceService]
"Attempted"=dword:00000001
"Installed"=dword:00000001

Options -> Advanced -> Update now shows the checkbox for the maintenance service.

>sc query MozillaMaintenance
SERVICE_NAME: MozillaMaintenance
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 1  STOPPED
        WIN32_EXIT_CODE    : 1077  (0x435)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
Your next update should be silent now. 

I don't think having write access into the install directory of program files should be a supported use case by the way. I think we should resolve this as invalid.
To add to Comment 1 for future people that have this problem there is a #5 for now as well:

5) Using a 64-bit native build.  Currently only x86 builds use the service temporarily.
OK, I've uninstalled Nightly and the Maintenance Service, deleted the reg key, deleted the remains of the app directory, installed an older nightly (2012-01-01), and updated to the latest nightly. The maintenance service was installed properly.

Looks like write access to the app directory was indeed the culprit.
Summary: Maintenance service is not installed on Nightly update → Maintenance service does not get installed if the user has write access to their installation directory.
I don't think we should install the service in this case.

The reason is because updates happen with an unelevatd updater in this case. 
But to update the maintenance service you need to be elevated.

We would have to make all updates elevated, which I don't think we are prepared to do at this time.
Closing this bug as wontfix per comment #8. If this is still an issue please file a new bug.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.