Salut a tous,
J'ai cree un logiciel en java, pour lequel j'ai cree un installer. Dans cet installer, j'ai fait en sorte que des raccourcis soient crees dans le menu Demarrer et sur le bureau, a l'aide d'un fichier .js
Je suis actuellement en train de creer l'uninstaller et je souhaiterais supprimer les raccourcis prealabalement crees. ca fonctionne pour les raccourcis du menu Demarrer, mais pas pour le raccourci du bureau...
Voici le code pour la creation des raccourcis:
WScript.Echo(\"Creating shortcuts...\");
Shell = new ActiveXObject(\"WScript.Shell\");
ProgramsPath = Shell.SpecialFolders(\"Programs\");
fso = new ActiveXObject(\"Scripting.FileSystemObject\");
if (!fso.folderExists(ProgramsPath + \"\\\\" + folder + "\"))
fso.CreateFolder(ProgramsPath + \"\\\\" + folder + "\");
link = Shell.CreateShortcut(ProgramsPath + \"\\\\" + folder + "\\\\" + name + ".lnk\");
link.Arguments = \"\";
link.Description = \"" + name + "\";
link.HotKey = \"\";
link.IconLocation = \"" + escaped(installDir.getAbsolutePath()) + "\\\\" + "RecipeManager.ico,0\";
link.TargetPath = \"" + escaped(installDir.getAbsolutePath()) + "\\\\" + runnable + "\";
link.WindowStyle = 1;
link.WorkingDirectory = \"" + escaped(installDir.getAbsolutePath()) + "\";
link.Save();
DesktopPath = Shell.SpecialFolders(\"Desktop\");
link = Shell.CreateShortcut(DesktopPath + \"\\\\" + name + ".lnk\");
link.Arguments = \"\";
link.Description = \"" + name + "\";
link.HotKey = \"\";
link.IconLocation = \"" + escaped(installDir.getAbsolutePath()) + "\\\\" + "RecipeManager.ico,0\";
link.TargetPath = \"" + escaped(installDir.getAbsolutePath()) + "\\\\" + runnable + "\";
link.WindowStyle = 1;
link.WorkingDirectory = \"" + escaped(installDir.getAbsolutePath()) + "\";
link.Save();
WScript.Echo(\"Shortcuts created.\");
Et pour la suppressions des raccourcis:
WScript.Echo(\"Creating shortcuts...\");
Shell = new ActiveXObject(\"WScript.Shell\");
ProgramsPath = Shell.SpecialFolders(\"Programs\");
fso = new ActiveXObject(\"Scripting.FileSystemObject\");
if (fso.folderExists(ProgramsPath + \"\\\\" + folder + "\"))
fso.RemoveFolder(ProgramsPath + \"\\\\" + folder + "\");
DesktopPath = Shell.SpecialFolders(\"Desktop\");
link = Shell.RemoveShortcut(DesktopPath + \"\\\\" + name + ".lnk\");
WScript.Echo(\"Shortcuts created.\");
Savez-vous pourquoi ca ne fonctionne pas ????
Merci d'avance.