PDA

View Full Version : Delete shortcut folder Problems!


Mike Lacaria
09-03-2009, 10:17 AM
Deleting shortcut folder: I've waisted way too much time already and can't find a solution in the archives, would appreciate any help from someone that knows this!

I created a shell shortcut (which works fine):

location=SetupData.GetAppShortcutFolderPath();
Shell.CreateShortcut(location, "folder mike", target, "", "", icon_path, 0, SW_SHOWNORMAL, nil, "run Mike");

I can't seem to delete this shortcut folder and shortcut program reference!

I think this should really be a feature in the program, a simple check mark feature to delete ALL installed references would be really useful!

pww
09-03-2009, 03:49 PM
How do you try to delete it?

Try
Shell.DeleteShortcut(location, "folder mike");

Note that stuff that installer created through script actions are not automatically removed by the uninstaller. They are to be removed the same way, through script actions.

Mike Lacaria
09-03-2009, 05:56 PM
the location is the problem, easy to get when installing but I can't seem to get it right during uninstall. I assumed (tried others too) it was Shell.DeleteShortcut(SessionVar.Expand("%AppShortcutFolderName%"), "folder mike") but it didn't work

The location was set at setup (default, user can't change it), how can I get it back without writing it somewhere?

SetupJuggler
09-04-2009, 07:31 AM
Hi,

that's the Setup Factory difficulty while acting within LUA script. Your Shell.CreateShortcut() is not automatic logged by the installer so it isn't handled by the uninstall. It is only done, if you create a shortcut via the properties dialog/shortcuts. That's too bad.

Use a session variable to do your task:

SessionVar.Set("%location%", SetupData.GetAppShortcutFolderPath());
Shell.CreateShortcut(SessionVar.Expand("%location%"), "folder mike", target, "", "", icon_path, 0, SW_SHOWNORMAL, nil, "run Mike");

-- in uninstall use the session variable
Shell.DeleteShortcut(SessionVar.Expand("%location%"), "folder mike");



Regards,
Udo