Menu

[r11]: / trunk / SWFInvestigator / src / updateManager / installManager.as  Maximize  Restore  History

Download this file

58 lines (53 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/****************************************************************************
* ADOBE SYSTEMS INCORPORATED
* Copyright 2012 Adobe Systems Incorporated and it’s licensors
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file
* in accordance with the terms of the license agreement accompanying it.
* ****************************************************************************/
package updateManager
{
import flash.desktop.NativeProcess;
import mx.controls.Alert;
public class installManager
{
private var updater:IUpdater;
private var configFile:String = "configs/updateConfig.xml";
/**
* @public
* This constructor will initialize the updater
*/
public function installManager()
{
if (NativeProcess.isSupported) {
this.updater = new NativeFileUpdater(configFile) as IUpdater;
} else {
this.updater = new AirFileUpdater(configFile) as IUpdater;
}
try {
this.updater.initialize();
} catch (e:Error) {
if (e.message) {
mx.controls.Alert.show ("Could not initialize updater!");
}
}
}
/**
* @public
* This will check for updates using whichever installer is appropriate.
* If this is a manual check then the system will show errors.
*
* @param manualCheck This indicates whether the call was initiated through user action.
*/
public function checkForUpdates(manualCheck:Boolean = false):void {
try {
this.updater.checkForUpdates(manualCheck);
} catch (e:Error) {
if (manualCheck) {
mx.controls.Alert.show("There was an error during the update process.\n\n" + e.message, "Update Error");
}
}
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.