home *** CD-ROM | disk | FTP | other *** search
- var bCont = true;
- try
- {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
-
- //get a folder in the Application folder (Binaries):
- var appPath = Session.TargetPath("_554AC43F6AE442F9B07A922E1BB4E098");
- var appFolder = fso.GetFolder(appPath);
- //get TheEasyBee free folder:
- var appFolder = appFolder.ParentFolder;
-
-
- //get a folder in the data folder (TheEasyBee Free):
- var dataPath = Session.TargetPath("_DE739F593C14415D924E99A9257D5963");
- var dataFolder = fso.GetFolder(dataPath);
- } catch(e)
- {
- logMessage("catch "+e.description);
- bCont = false;
- }
-
- try
- {
- delShortcut();
- } catch(e){logMessage("catch "+e.description);}
- if (bCont)
- {
- try
- {
- delFolder(appFolder);
- } catch(e){logMessage("catch "+e.description);}
-
- try
- {
- delFolder(dataFolder);
- } catch(e){logMessage("catch "+e.description);}
- }
-
- function delFolder(fold)
- {
- logMessage("Deleting "+fold.Path);
- var parentFold = fold.ParentFolder;
- fso.DeleteFolder(fold.Path);
-
- //delete parent folder up to a folder named "Altercept"
- //check that the folder name does not contain "program"
-
- //this one should be named "Altercept"
- //delete it only if no folder in it
- var subFolds = parentFold.SubFolders;
- if (subFolds.Count == 0 && parentFold.Name == "Altercept")
- {
- logMessage("Deleting "+parentFold.Path);
- fso.DeleteFolder(parentFold.Path);
- }
- }
- function delShortcut()
- {
- WshShell = new ActiveXObject("WScript.Shell");
- var desk = WshShell.SpecialFolders("Desktop");
- fso.DeleteFile(desk+"\\The Easy Bee.lnk");
- }
-
- function logMessage(msg)
- {
-
- var inst = Session.Installer;
-
- var rec = inst.CreateRecord(1);
-
- rec.StringData(0) = "Altercept Message "+msg;
-
- Session.Message(0x04000000, rec);
- }