Does anyone have the syntax needed to run a clickonce application. I've tried
RunProgram(executable("clickonce application"));
Which I figured wouldn't work. Are there any other options?
The following might be of use, it was taken from:
http://www.brad-smith.info/blog/archives/535
Unlike normal executables, applications deployed using ClickOnce are started using a bootstrapper (which is normally handled by the shell). This includes applications written in Windows Forms, WPF or Silverlight. Shortcuts to ClickOnce apps have the extension .appref-ms (rather than .lnk for regular shortcuts), and these files are not recognised by the start command (as in the previous example).
Thankfully, they can be run using the following syntax:
1 | rundll32.exe dfshim.dll,ShOpenVerbShortcut [path to appref-ms file] |
Where [path to appref-ms file] is the full path to the ClickOnce shortcut file. The path may include environment variables such as %USERPROFILE% if, for example, you want to point to a shortcut on the user’s desktop.
How does this work?
The rundll32 method works by itself but I cannot find a way to pass parameter to the .appref-ms. I eventually solved the problem by using the following:
RunProgram(
executable( "cmd.exe" ),
options(
{"/c",
"\!"PathToShortcut.appref-ms\!"",
"parameter"}
),
readfunction( "text" )
);I added the double quotes to my PathToShortcut.appref-ms because it has spaces.
Using the rundll32 method, the parameter can be passed to the clickonce program like below:
RunProgram(
executable( "rundll32.exe" ),
options( {"dfshim.dll,ShOpenVerbShortcut","PathToShortcut.appref-ms|parameter"} ),
readfunction( "text" )
);
I figured it out after enough poking around.
web("clickonce application.appref-ms");