cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Techie42
Level 6

patching shortcuts

I have a base product out in the wild. I am creating a patch for it. Our marketing guys want to update the menu shortcut names.

I am not sure how I would delete the short cut and then create the new one during the patch's re-install runtime.

Thanks Folks!

Bradley
Labels (1)
0 Kudos
(6) Replies
Techie42
Level 6

Okay then from what I have found it looks like I neeed to remove the plug in with an uninstall action to the bean number of the existing short cut and then create a new plug in.
0 Kudos
Techie42
Level 6

Techie42 wrote:
Okay then from what I have found it looks like I neeed to remove the plug in with an uninstall action to the bean number of the existing short cut and then create a new plug in.


Okay that did not work. I can create the new shortcuts but I can not remove the old shortcuts.

I did a seach and found Robert Dickau's thread about DesktopService. So I tried this but it does not find my displayname for the shortcut items.

I am trying...

import com.installshield.wizard.*;
import com.installshield.wizard.service.*;
import com.installshield.product.service.desktop.*;


public class RemoveShortcuts extends WizardAction
{
public void execute(WizardBeanEvent event)
{
try
{
DesktopService ds = (DesktopService)getService(DesktopService.NAME);
ds.removeDesktopItem("$UsersPrograms$\\Texas Instruments" , "Uninstall CCE v3");
ds.removeDesktopItem("$AllUsersPrograms$\\Texas Instruments" , "Code Composer Essentials v3");
ds.removeDesktopItem("$AllUsersDesktop$" , "Code Composer Essentials v3");
}
catch(ServiceException se) { System.out.println (se.getMessage());}
}

public void build(WizardBuilderSupport support)

{
support.putRequiredService(DesktopService.NAME);
}


}


When this runs it does not remove the shortcuts.

Also When I compile this I get a warning message:

Note: RemoveShortcuts1.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
0 Kudos
RobertDickau
Flexera Alumni

Please see the newest ISMP API javadocs: the two-argument removeDesktopItem method is deprecated in favor of a three-argument version, where the context ($Somewhere$) is a separate argument. Please see KB article Q112447, for example.
0 Kudos
Techie42
Level 6

RobertDickau wrote:
Please see the newest ISMP API javadocs: the two-argument removeDesktopItem method is deprecated in favor of a three-argument version, where the context ($Somewhere$) is a separate argument. Please see KB article Q112447, for example.


From the KB I see:
service.removeDesktopItem("$AllUsersPrograms$", "folder", "name");

So for my example...
ds.removeDesktopItem ("$UserPrograms$" , "\\Texas Instruments\\Code Composer Essentials v3" , "Uninstall CCE v3")

Thanks!
0 Kudos
RobertDickau
Flexera Alumni

From memory I'm not sure whether you need the \\ at the beginning of the subfolder name, but that generally looks right...
0 Kudos
Techie42
Level 6

Yes that worked.

Thank you again Robert!
0 Kudos