@ -17,6 +17,12 @@ See the License for the specific language governing permissions and
limitations under the License .
* /
// Squirrel on windows starts the app with various flags
// as hooks to tell us when we've been installed/uninstalled
// etc.
const check _squirrel _hooks = require ( './squirrelhooks' ) ;
if ( check _squirrel _hooks ( ) ) return ;
const electron = require ( 'electron' ) ;
const url = require ( 'url' ) ;
@ -29,6 +35,7 @@ const PERMITTED_URL_SCHEMES = [
] ;
const UPDATE _POLL _INTERVAL _MS = 60 * 60 * 1000 ;
const INITIAL _UPDATE _DELAY _MS = 30 * 1000 ;
let mainWindow = null ;
let appQuitting = false ;
@ -107,7 +114,10 @@ electron.app.on('ready', () => {
// do it in the main process (and we don't really need to check every 10 minutes:
// every hour should be just fine for a desktop app)
// However, we still let the main window listen for the update events.
pollForUpdates ( ) ;
// We also wait a short time before checking for updates the first time because
// of squirrel on windows and it taking a small amount of time to release a
// lock file.
setTimeout ( pollForUpdates , INITIAL _UPDATE _DELAY _MS ) ;
setInterval ( pollForUpdates , UPDATE _POLL _INTERVAL _MS ) ;
} catch ( err ) {
// will fail if running in debug mode
@ -115,7 +125,7 @@ electron.app.on('ready', () => {
}
mainWindow = new electron . BrowserWindow ( {
icon : ` ${ _ _dirname } /../../vector/img/logo.png ` ,
icon : ` ${ _ _dirname } /../img/riot.ico ` ,
width : 1024 , height : 768 ,
} ) ;
mainWindow . loadURL ( ` file:// ${ _ _dirname } /../../vector/index.html ` ) ;