INF and Shortcuts command line switch

C

Craig

Ok, here's a challenge for you. I want to create a CAB file using
CabWiz and INF that creates a Shortcut in the \Windows\StartUp folder
to the following...

"\Program Files\MyApp\MyApp.exe" -h

I could do this by manually creating an LNK file with the right path
and use CabWiz to copy the LNK file to that location.

However, this doesn't support none-English devices, so I should use
[Shortcuts] instead... but this doesn't let me add the all important
'-h' switch.

Any ideas?

TIA

Craig


[Version]
Signature="$Windows NT$"
Provider="My Company"
CESignature="$Windows CE$"

[CEStrings]
AppName="MyApp"
InstallDir=%CE1%\%AppName%

[CEDevice]
VersionMin=3.00
VersionMax=4.99

[DefaultInstall]
CEShortcuts=Shortcuts, StartUp
CopyFiles=Files.Common

[SourceDisksNames]
1=,"Common1",,"C:\Documents and Settings\My Documents\Visual Studio
Projects\MyApp\obj\Release\"

[SourceDisksFiles]
MyApp.exe=1

[DestinationDirs]
Files.Common=0,%InstallDir%
StartUp=0,%CE4%
Shortcuts=0,%CE2%\Start Menu

[Files.Common]
MyApp.exe,,,0

[Shortcuts]
%AppName%,0,MyApp.exe,%CE11%

[StartUp]
%AppName%,0,MyApp.exe
 
A

Alex Feinman [MVP]

I suppose you can create a .lnk file on the desktop and include it in the
cab with the target directory set to %CE17% (Start menu)
The format of a shortcut file is (one line of text)

xx#\path\to\app.exe -parameter

where xx is a string length. E.g.

32#"\Windows\SQLCE 2.0\isqlw20.exe"

If the app path has spaces it needs to be quoted (but do not put the
parameters inside the quotes)
 
C

Craig

Hi Alex, thanks for the response, unfortunately I think this is a
rather thorny problem.

Don't think I can place a directory ID (like %CE1%) inside a .lnk
(well, I gave it a whirl and it didn't seem to work).

And I need the path to the app inside the .lnk to vary depending on
the region the CAB is installed, so normally Shortcuts would be the
way to go but I can't add my command line switch.

Any more ideas?

Craig


Alex Feinman said:
I suppose you can create a .lnk file on the desktop and include it in the
cab with the target directory set to %CE17% (Start menu)
The format of a shortcut file is (one line of text)

xx#\path\to\app.exe -parameter

where xx is a string length. E.g.

32#"\Windows\SQLCE 2.0\isqlw20.exe"

If the app path has spaces it needs to be quoted (but do not put the
parameters inside the quotes)

[snip]
 
A

Alex Feinman [MVP]

Craig,

I see the problem with my previous reply. While I cannot ascertain that
there is no way to achieve what you need by means of cleverly constructed
..inf file, I can suggest a couple of workarounds. Workaround #1 is to have a
very small launcher app that would get the actual parameters from a registry
settings and start your main app passinng these arguments to it.
Workaround #2 (a preferred solution ) is to have a custom CESetupDLL that
would create a shortcut for you during the installaion process

--
Alex Feinman
---
Visit http://www.opennetcf.org
Craig said:
Hi Alex, thanks for the response, unfortunately I think this is a
rather thorny problem.

Don't think I can place a directory ID (like %CE1%) inside a .lnk
(well, I gave it a whirl and it didn't seem to work).

And I need the path to the app inside the .lnk to vary depending on
the region the CAB is installed, so normally Shortcuts would be the
way to go but I can't add my command line switch.

Any more ideas?

Craig


Alex Feinman said:
I suppose you can create a .lnk file on the desktop and include it in the
cab with the target directory set to %CE17% (Start menu)
The format of a shortcut file is (one line of text)

xx#\path\to\app.exe -parameter

where xx is a string length. E.g.

32#"\Windows\SQLCE 2.0\isqlw20.exe"

If the app path has spaces it needs to be quoted (but do not put the
parameters inside the quotes)

[snip]
 
C

Craig

Hi Alex. I'd considered using a launcher app, but wasn't sure whether
this was a little too clunky.

The CESetupDLL sounds very interesting...I'll have a look around and
see whether this will answer my question.

Thanks for your time.

Craig

Alex Feinman said:
Craig,

I see the problem with my previous reply. While I cannot ascertain that
there is no way to achieve what you need by means of cleverly constructed
.inf file, I can suggest a couple of workarounds. Workaround #1 is to have a
very small launcher app that would get the actual parameters from a registry
settings and start your main app passinng these arguments to it.
Workaround #2 (a preferred solution ) is to have a custom CESetupDLL that
would create a shortcut for you during the installaion process

[snip]
 
K

Kim Barnett

Try something like

[Shortcuts]
%AppName%,0,MyApp.exe,%CE11%
%AppName%,0,"MyApp.exe" -h,%CE4%


Works for me.

Kim

Craig said:
Hi Alex. I'd considered using a launcher app, but wasn't sure whether
this was a little too clunky.

The CESetupDLL sounds very interesting...I'll have a look around and
see whether this will answer my question.

Thanks for your time.

Craig

Alex Feinman said:
Craig,

I see the problem with my previous reply. While I cannot ascertain that
there is no way to achieve what you need by means of cleverly constructed
.inf file, I can suggest a couple of workarounds. Workaround #1 is to
have a
very small launcher app that would get the actual parameters from a
registry
settings and start your main app passinng these arguments to it.
Workaround #2 (a preferred solution ) is to have a custom CESetupDLL that
would create a shortcut for you during the installaion process

[snip]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top