Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one pass command line argument to a ClickOnce application?

Tags:

I have a Clickonce application that is launched from the start menu (local). I would like to be able to specify a parameter so that the application can load certain data. The application lives on a fileshare and will be launched using the URL only once (like described here on MSDN). This implies that the method describe in this link will not work; users will be launching the application using an .appref-ms shortcut in the Start Menu.

I haven't been able to find a solution. Is it possible to somehow pass a parameter into the click once application? If so, how? If not, what are some alternatives?

like image 585
Szymon Rozga Avatar asked Jan 09 '09 19:01

Szymon Rozga


People also ask

How do I ClickOnce deployment?

In the Publish wizard, select Folder. In the Specific target page, select ClickOnce. Enter a path or select Browse to select the publish location. In the Install location page, select where users will install the application from.

How do you add prerequisites to a ClickOnce application?

ClickOnce allows you to add prerequisites in ClickOnce deployment. It should download the installer packages for those prerequisites to your development machine. When you publish the ClickOnce application, choose Download prerequisites from the same location as my application.

What is a ClickOnce application reference?

Application reference file used by ClickOnce, a Microsoft platform used to deploy and run remote Web applications; contains a local or remote link to an application; commonly used to enable links from the Windows Start Menu.

How do I add files to ClickOnce deployment?

To add a file to a group Click the Publish tab. Click the Application Files button to open the Application Files dialog box. In the Application Files dialog box, select the Group field for a file that you wish to include in the new group. In the Download Group field, select a group from the drop-down list.


1 Answers

Since you get to the deployment manifest via a Url, you can pass all of that information via the query string (e.g. http://clickonce.example.com/shell.application?p1=this&p2=that)

I was going to type out the steps, then googled and found this blog that basically lists out all the steps. I've done something similar in one instance with no issues. The only slightly difficult thing is that you have to re-mage after setting things up, but if you got it to deploy in the first place, you already know how to set things up.

Good luck!

like image 142
joshua.ewer Avatar answered Sep 17 '22 15:09

joshua.ewer