home *** CD-ROM | disk | FTP | other *** search
/ PC User 2004 March / PCU0304CD2.iso / software / online / files / easybee2.msi / Binary.uninstallDirs < prev    next >
Encoding:
Text File  |  2004-01-06  |  1.7 KB  |  74 lines

  1. var bCont = true;
  2. try
  3. {
  4.     var fso = new ActiveXObject("Scripting.FileSystemObject");
  5.  
  6.     //get a folder in the Application folder (Binaries):
  7.     var appPath = Session.TargetPath("_554AC43F6AE442F9B07A922E1BB4E098");
  8.     var appFolder = fso.GetFolder(appPath);
  9.     //get TheEasyBee free folder:
  10.     var appFolder = appFolder.ParentFolder;
  11.  
  12.  
  13.     //get a folder in the data folder (TheEasyBee Free):
  14.     var dataPath = Session.TargetPath("_DE739F593C14415D924E99A9257D5963");
  15.     var dataFolder = fso.GetFolder(dataPath);
  16. } catch(e)
  17. {
  18.     logMessage("catch "+e.description);
  19.     bCont = false;
  20. }
  21.  
  22. try
  23. {
  24.     delShortcut();
  25. } catch(e){logMessage("catch "+e.description);}
  26. if (bCont)
  27. {
  28.     try
  29.     {
  30.         delFolder(appFolder);
  31.     } catch(e){logMessage("catch "+e.description);}
  32.  
  33.     try
  34.     {
  35.         delFolder(dataFolder);
  36.     } catch(e){logMessage("catch "+e.description);}
  37. }
  38.  
  39. function delFolder(fold)
  40. {
  41.     logMessage("Deleting "+fold.Path);
  42.     var parentFold = fold.ParentFolder;
  43.     fso.DeleteFolder(fold.Path);    
  44.     
  45.     //delete parent folder up to a folder named "Altercept"
  46.     //check that the folder name does not contain "program"
  47.     
  48.     //this one should be named "Altercept"
  49.     //delete it only if no folder in it
  50.     var subFolds = parentFold.SubFolders;
  51.     if (subFolds.Count == 0 && parentFold.Name == "Altercept")
  52.     {
  53.         logMessage("Deleting "+parentFold.Path);
  54.         fso.DeleteFolder(parentFold.Path);
  55.     }
  56. }
  57. function delShortcut()
  58. {
  59.     WshShell = new ActiveXObject("WScript.Shell");
  60.     var desk = WshShell.SpecialFolders("Desktop");
  61.     fso.DeleteFile(desk+"\\The Easy Bee.lnk");
  62. }
  63.  
  64. function logMessage(msg)
  65. {
  66.  
  67.     var inst = Session.Installer;
  68.     
  69.     var rec = inst.CreateRecord(1);
  70.     
  71.     rec.StringData(0) = "Altercept Message "+msg;
  72.     
  73.     Session.Message(0x04000000, rec);
  74. }