Skip to content

Commit

Permalink
Temporarily disable Windows 10 cloud storage provider support
Browse files Browse the repository at this point in the history
It's too easy to end up with a broken shortcut right now.
  • Loading branch information
sebn committed Jul 11, 2017
1 parent 54a79b0 commit 33c4ecc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions gui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const debounce = require('lodash.debounce')
const os = require('os')
const path = require('path')
const url = require('url')
const uuid = require('node-uuid')
// const uuid = require('node-uuid')

const {spawn} = childProcess
const {app, BrowserWindow, dialog, ipcMain, Menu, shell, session} = electron
Expand Down Expand Up @@ -518,6 +518,7 @@ const execSync = (cmd) => {
console.log(output)
}

/*
// Retrieve the Windows SID for the current user
const windowsCurrentUserSID = () => {
const {username} = os.userInfo()
Expand Down Expand Up @@ -567,6 +568,7 @@ const windowsUnregisterCloudStorageProvider = (windowsConfig) => {
execSync(`reg delete HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{${clsid}} /f`)
execSync(`reg delete HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel /v {${clsid}} /f`)
}
*/

const sfltoolAddFavorite = (path) => {
const item = url.resolve('file://', path)
Expand All @@ -579,10 +581,13 @@ const major = Number.parseInt(os.release().split('.')[0])
// https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history

const addFileManagerShortcut = (config) => {
/*
if (platform === 'win32' && major >= 10) {
const windowsConfig = windowsRegisterCloudStorageProvider(config.syncPath)
config.save('windows', windowsConfig).then(() => config.persist())
} else if (platform === 'darwin' && major >= 15) {
} else
*/
if (platform === 'darwin' && major >= 15) {
// sfltool is available since 10.11 (El Capitan)
sfltoolAddFavorite(config.syncPath)
} else {
Expand All @@ -591,6 +596,7 @@ const addFileManagerShortcut = (config) => {
}

const removeFileManagerShortcut = (config) => {
/*
if (platform === 'win32' && major >= 10) {
const windowsConfig = config.config.windows
if (windowsConfig) {
Expand All @@ -599,8 +605,11 @@ const removeFileManagerShortcut = (config) => {
console.log('Not unregistering shortcut because windows config is missing')
}
} else {
console.log(`Not unregistering shortcut on ${platform} ${major}`)
*/
console.log(`Not unregistering shortcut on ${platform} ${major}`)
/*
}
*/
// FIXME: Not removing favorite on macOS >= 10.11 since sfltool does not support it.
}

Expand Down

0 comments on commit 33c4ecc

Please sign in to comment.