Squirrel.windows: Location of SquirrelTemp

Created on 6 Jun 2019  路  4Comments  路  Source: Squirrel/Squirrel.Windows

Squirrel version(s)
Squirrel 1.9.1

Description
SquirrelTemp gets created in the root of the C-drive, as well as in C:\ProgramData on Windows 10.

Steps to recreate
This one is a real Schr枚dinger's bug as I have been unable to consistently recreate it and properly debug through it.

But, under certain conditions, when installing our Squirrel-aware application, an empty SquirrelTemp folder will be created in the root of the system drive, commonly C:. In some cases, an empty SquirrelTemp folder will be located within C:\ProgramData instead.

The proper SquirrelTemp folder, with the expected installation log, will still be located under C:\Users\\AppData\Local. There is no mention of any other SquirrelTemp folder within the log.

While I have been unable to determine a pattern, the bug seems to be most common on clean systems on which our application has never been installed, or systems where every trace of it has been purged.

As this bug has been observed within the R&D department of our organization, the user installing the application will usually be an Administrator.

Expected behavior
Out of many installs, I have been able to confirm the creation of C:\SquirrelTemp 3 times on my own system.

Actual behavior
Obviously, the C:\SquirrelTemp should never be created.

Additional information
The bug has only been observed on Windows 10.

Most helpful comment

@frederikolsen88 To be clear, if Squirrel writes to C:\ it's only because someone has seriously screwed up their registry settings for a core OS configuration setting, this is _not_ what Squirrel does by default.

If you're writing an app that will _solely_ be deployed in highly locked-down environments, I would consider using a different installer - while Squirrel will most likely work with the MSI, they're probably going to be Grumpy about how it works, as well as the idea of software updating without their explicit deploys. Squirrel is kind of designed to work _around_ IT Admins, not with them 馃槄

All 4 comments

Squirrel will attempt to put its temp directory at several places when it fails due to permissions issues - it never tries to directly put it into the root directory intentionally, but if your machine has bugged registry keys for things like the location of "C:\ProgramData" or has set the SQUIRREL_TEMP variable, it could end up there.

The order is (as I recall):

  • SQUIRREL_TEMP
  • Your user's temp directory
  • ProgramData\SquirrelTemp

We do this because literally any environment variable or system setting has been found to be untrustworthy (i.e. "TEMP" being set to "") or unusable on various machines, so Squirrel tries really really hard to find a usable place, even if it's Not Ideal

Thank you for your response, @anaisbetts!

Is there any way I can define the SquirrelTemp location myself during OnInitialInstall and OnAppUpdate, or do those events get fired too late? The logic you've outlined above makes perfect sense, and it's probably the only way for Squirrel to do it, but the application I'm working on is likely to be used in the defense industry, so writing to the root of C:\ is likely to either be blocked by default by overzealous security (presumably screwing up the install), or get us a serious reprimand some day!

@frederikolsen88 To be clear, if Squirrel writes to C:\ it's only because someone has seriously screwed up their registry settings for a core OS configuration setting, this is _not_ what Squirrel does by default.

If you're writing an app that will _solely_ be deployed in highly locked-down environments, I would consider using a different installer - while Squirrel will most likely work with the MSI, they're probably going to be Grumpy about how it works, as well as the idea of software updating without their explicit deploys. Squirrel is kind of designed to work _around_ IT Admins, not with them 馃槄

That's a good point! I don't recall reading the bit about working around IT admins in the readme, but I'll take it :wink:

Ultimately, it's of no immediate concern since we're probably not shipping the software out to customers in the near future. But I'll send our IT admin a notice as it sounds like certain registry keys are basically screwed up by default. Thanks for your help!

Was this page helpful?
0 / 5 - 0 ratings