Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Dynamic Shortcut Parameters

Dynamic Shortcut Parameters 4 years, 5 months ago #313

  • MarcosV
  • OFFLINE
  • Fresh Boarder
  • Karma: 0
Hi,

I was the person who posted the thread \"Shortcut To Launch LNK File\". The additional ability to add parameters to the application shortcut has helped out a great deal.

When the application is installed to the \"Device\", everything works great. However, when the softwae is installed to the \"Storage Card\", a problem occurs.

The problem is that the parameters I'm adding to the shortcut need to know whether the application was installed to the device or storage card.

One of the arguments in the shortcut parameters looks like this:

\"-cp\" \"\Program Files\\eCP.jar\"

This works fine when the software is installed to the device since the path in the argument is assuming that it needs to look in the \"Program Files\" of the root file system.

However, if the software is installed to the storage card than the argument becomes invalid and should instead look like this:

\"-cp\" \"\Storage Card\Program Files\\eCP.jar\"


Is there a way to make the shortcut parameters dynamic so that they can change depending on whether the user selects to install the software on the device or on the storage card?

I tried doing this in the parameters list:

\"-cp\" \"\%InstallDir%\eCP.jar\"

But it did not seem to work...

Any suggestions?

Thanks very much for the hlep!

Jim

Re:Dynamic Shortcut Parameters 4 years, 5 months ago #314

  • nick_tg
  • OFFLINE
  • Moderator
  • Karma: 4
Hi,

There is no way for PPCIC to know at design time where the user will choose to install a program, in internal memory or in an external card. So, you can't make shortcuts pointing to different locations in design time.

A little theory now. CAB files have a limitation of the way they create shortcuts. The programmer can't define shortcut's properties, such as icon and parameters. PPCIC overcomes this by creating shortcuts in compile time, depending programmer's wishes and embeds them as regular files into the CAB installation. This is done transparent and for programmer and for end user. just take a look in the generated .inf file to see what i mean.

Look here for information of what shortcuts .lnk files are actually are:
blogs.msdn.com/mikehall/archive/2005/08/22/454922.aspx
bansky.net/blog/2007/09/creating-shortcu...tphone/comments.html

Now, the solution to your problem. It is called setup.dll. CAB installations have a special entry for a dll, which is called during setup. You can make one, which create the shortcut when installation finishes. When you make it, simple add it into CAB Creator Module -> Mobile Device Files as a regular file and then, go to CAB Creator Module -> Registry and Shortcuts and fill the entry Setup DLL with the filename previous entered into Mobile Device Files.

For your easy, i search a while and found a Windows Mobile API function which creates shortcuts, SHCreateShortcut
msdn2.microsoft.com/en-us/library/ms959231.aspx

And because the work must be done till the end, here it is the source of such a dll which creates a shortcut at the end of installation targeting at the actual directory application is installed. See this source as a starting point for further customization.

Attachment setup.zip not found



Regards,
Nick Protopapas
Attachments:
  • Page:
  • 1
Time to create page: 0.23 seconds