Squirrel / Squirrel.Mac

:shipit: Cocoa framework for updating OS X apps :shipit:
MIT License
1.59k stars 128 forks source link

Application becomes translocated after auto-update #252

Open jhohiselkeeper opened 4 years ago

jhohiselkeeper commented 4 years ago

I have recently discovered that our Electron app is not properly installed at the /Applications directory after auto-update. The app does exist in the Applications directory, however it is still translocated.

Steps followed: Install app via drag-and-drop in Finder to /Applications Launch app with update available (app is not translocated) Close application, Squirrel/ShipIt installs the new version (overwriting in the directory /Applications) Launch updated app, app is translocated

This unfortunately causes future updates to not occur, as the app ends up running from a read-only disk image due to translocation.

The underlying cause of this issue seems to be related to using the rename(2) system call in installItemToURL to move the application from the temp directory back to /Applications.

$ sudo dtruss -a -s -t rename -n ShipIt

29632/0x846c5:    165237     268    157 rename("/var/folders/vh/yqwtvs497p7bd0tn091h0c180000gn/T/com.keepersecurity.passwordmanager.ShipIt.y1qHRve4/Keeper Password Manager.app\0", "/Applications/Keeper Password Manager.app\0")       = 0 0
XRenSiu commented 2 years ago

I have the same question.

peach365 commented 2 years ago

How did you solve this problem

beyondkmp commented 1 year ago

I have the same question.

beyondkmp commented 1 year ago

The problem I encountered has been resolved in this PR. https://github.com/electron/electron/pull/36130