Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/alternative autostart win #1311

Merged
merged 7 commits into from Aug 26, 2020
Merged

Conversation

infeo
Copy link
Member

@infeo infeo commented Aug 20, 2020

This PR closes #1251 by implementing a fallback strategy using the autostart folder when the user enables the auto start option in cryptomator.

BeyerMart and others added 4 commits July 8, 2020 14:01
* prevented on best effort basis inconsistent states
* extracted the registry setting as an own strategy (by methods)
* refactored the overriden methods to call the strategies (registry or folder) depending on the different variables
* removed Powershell specific ToggleException
* added documentation
@infeo infeo added this to the 1.5.8 milestone Aug 20, 2020
@infeo infeo requested a review from BeyerMart August 20, 2020 10:24
@infeo
Copy link
Member Author

infeo commented Aug 20, 2020

@overheadhunter Regarding the symbolic links, normally one need admin priviliges to create them in Windows, therefore, this is not a feasible way (at least for the time being).

@overheadhunter
Copy link
Member

overheadhunter commented Aug 20, 2020

@overheadhunter Regarding the symbolic links, normally one need admin priviliges to create them in Windows, therefore, this is not a feasible way (at least for the time being).

Since these shortcuts are per user, I guess there should also be a user-owned auto start dir, i.e. where the user can add his*her own startup items without admin privileges.

Edit: To be more precise: The folder in question seems to be ~\AppData\Roaming\Microsoft\Windows\Start Menu\Programs, which the user has write access to unless the Windows installation is garbled.

@infeo
Copy link
Member Author

infeo commented Aug 20, 2020

This actually doesn't matter. As long as the local Windows installation is not in developer mode, admin priviliges are required to create symbolic links (independet from location or target) (see for example here)

overheadhunter and others added 2 commits August 20, 2020 13:38
(cherry picked from commit 8c4d35d)
* corrected bad english
* improved documentation
* restricted visibility of specific exception
@overheadhunter
Copy link
Member

So shortcuts are not symlinks?

@infeo
Copy link
Member Author

infeo commented Aug 20, 2020

So shortcuts are not symlinks?

Yes. Shortcuts are real files with all the consequences (applications must support this file type, they have an extension, etc.) , while symbolic links are references on the the filesystem level.

@overheadhunter
Copy link
Member

So shortcuts are not symlinks?

Yes. Shortcuts are real files with all the consequences (applications must support this file type, they have an extension, etc.) , while symbolic links are references on the the filesystem level.

Is the shortcut "format" well-defined and can we create such a "normal" file with shortcut-content ourselves? I still would prefer not to launch some ps script.

@infeo
Copy link
Member Author

infeo commented Aug 26, 2020

Is the shortcut "format" well-defined and can we create such a "normal" file with shortcut-content ourselves?

It is a binary format, hence i don't believe we can create it by ourselve. There is also no documenation about its format. The other way than using a ps script would be using the native API. Since Cryptomator has a native-library dependency, this could be done in the future, but for now i would suggest to roll with the powershell solution.

@tobihagemann
Copy link
Member

Shouldn't this be the documentation? https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-shllink/16cb4ca1-9339-4d0c-a68d-bf1d6cc0f943

Doesn't look so simple though. 😆

@infeo
Copy link
Member Author

infeo commented Aug 26, 2020

@tobihagemann thanks, i didn't know that. But yeah, skimming through the documenation, it seems like it would be worth a whole library by its own..

Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- main/ui/src/main/java/org/cryptomator/ui/preferences/AutoStartWinStrategy.java  1
         

See the complete overview on Codacy

@infeo infeo merged commit fee2d4b into develop Aug 26, 2020
@tobihagemann tobihagemann modified the milestones: 1.5.8, 1.5.9 Aug 27, 2020
@infeo infeo deleted the feature/alternativeAutostartWin branch November 2, 2020 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cryptomator does not remember autostart setting
5 participants