home *** CD-ROM | disk | FTP | other *** search
- function update()
- {
- app = new ActiveXObject('FSI.FSIApplication');
- version = app.GetRegistryString(true, 'Version');
- version = version.split('.')[0];
- versionInfo = app.GetRegistryString(true, 'VersionInfo');
- thePath = app.AppDirectory + 'FSIUpdater\\Updater.exe'
-
- if (app.CurrentUpdater < app.LatestUpdater)
- {
- app.OpenStatusDialog('Updating', '\nGetting updater file information...');
- result = updateUpdater(app, thePath);
- app.CloseStatusDialog(0);
- if (!result)
- {
- app.DeleteTempDir();
- window.showModalDialog("../InitFusion/UpdateIncomplete.html", 0,
- "status:no;help:no;border:thin;dialogWidth:205px;dialogHeight:110px;center:yes;scroll:no;");
- return false;
- }
- }
-
- app.Spawn(thePath, '/auto', app.GetTempDir(), '', '', '');
- app.RunFSI(app.GetTempDir() + '\\Update.html', 'run()');
- return app.GetInstVar('update');
- }
-
- function updateUpdater(app, localPath)
- {
- request = 'Application=Fusion&Version=' + version + '&VersionInfo=' + versionInfo + '&Type=UpdaterUpdate';
- response = app.HttpRequest('http://www.netobjects.com/update/UpdateFile.cgi', '', request, false, false, true);
-
- app.StatusDialogText('\nDownloading updater file...');
-
- args = response.split(',');
- if (args.length < 8)
- return false;
-
- port = (args[3].length == 0 ? 21 : args[3]);
- path = args[6];
-
- localArgs = path.split('/');
-
- if (!app.GetFile(args[0], args[1], args[2], port, false, args[4], args[5], path, localPath, args[7] == 'binary'))
- return false;
-
- app.CurrentUpdater = app.LatestUpdater;
- return true;
- }