Skip to content

Instantly share code, notes, and snippets.

@valyard
Created August 29, 2013 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valyard/6374271 to your computer and use it in GitHub Desktop.
Save valyard/6374271 to your computer and use it in GitHub Desktop.
protected function restart(event:Event = null):void {
NativeApplication.nativeApplication.dispatchEvent( new Event(Event.EXITING) );
NativeApplication.nativeApplication.exit();
if ( NativeProcess.isSupported ) {
var app:File = File.applicationDirectory.resolvePath( App._airConfig.filename + ".exe" );
if ( !app.exists ) return;
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = app;
var process:NativeProcess = new NativeProcess();
process.start(nativeProcessStartupInfo);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment