invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Windows Services and Extraction Location

We use AI to install a Windows Service. We ran into issue with Windows 7 64-bit. I presume Microsoft locks down the OS as it matures and thereby makes it harder to get things to work.

When the product gets initially installed, it happens in a user account (typically the administrator account). At this moment in the product's life cycle you are basically setting up the service as “system local account” from a “user local account.”

After setup, the service is running as “system local account” and you can't expose any UI and processes will crash if you try.

We update frequently and want this to be automatic and not bother the user (like Google does with Chrome). So, from our service we launch update like this: Update.exe /silentall -nofreqcheck -url http://example.com/update.txt

Our update.exe would fail if we used the default Bootstrapper → Install Option → Extract Location of [AppDataFolder][Company]\[|ProductName] [|ProductVersion]\install. We had to change the [AppDataFolder] to [TempFolder].

I guess the brief question is: Does this concern you? Should the user clear the temp directory our setup will be gone. I've tested a further update of our product after the temp directory has been cleared and it seems OK. But I'm a little concerned to be putting the directory there.

Again, I go back to the fact the product is installed in one context (User account) and updated in another (system local account).

User account [TempFolder] resolves to: C:\Users\posiq\AppData\Local\Temp
System local account [TempFolder] resolves to: C:\windows\temp

User account [AppDataFolder] resolves to: c:\users\<user>\AppData\Roaming\ Our company directory exists here after setup.
System local account [AppDataFolder] resolves to: C:\windows\system32\config\systemprofile\AppData\Roaming\ Our company directory does not exist here after update. (When I change [AppDataFolder] to [TempFolder] for our updater then I see our company directory exists in C:\windows\temp after an update)

Is there a file location a Windows Service product should be using in place of [AppDataFolder]? A location that will be consistent between user account and a system local account.
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Windows Services and Extraction Location

"TempFolder" is the correct location to use when you need to install the package from within the System user account. This location is recommended by us too to other users.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”