|
I have an application that is using the install "From a UNC path or file share" option in clickonce. It would be nice to pass in command line parameters to this application to facilitate cross program usability in our shop. I have been looking online and so far the only thing I can see is deploying the application from a web site and using querystring parameters. This application needs to run offline as well as online. Can I call a clickonce application and pass in commandline arguements? I chose clickonce to help with the updates and force users to always use the latest version, this assists us with auditors and helps push out the latest version as well. The only thing missing is the command line option.
I am using VB 2008 to develop. - Moved byMartin Xie - MSFTMSFTTuesday, September 01, 2009 3:45 AMMove it to ClickOnce Deployment forum for better support. (From:Visual Basic General)
-
| | katghoti Monday, August 31, 2009 3:26 PM | Let me clarify my original post. You can not have automatic updates, run offline/online, and use query parameters. You could try to track down the exe file and run it and pass in the parameters, but if you do that, it will not run as a ClickOnce application, i.e. won't pick up the updates. Plus, every time there IS an update, the exe file moves. You would be better off writing your own update method. All you have to do is build it into the program. Check a version number against one in a database or in a shared file (ClickOnce uses the manifest), and if the version changes, call a separate exe and shut down. The separate exe would copy the new verison over and call the application again to run. About your only other choice is to write the data you want passed in somewhere, and have the application look for the files and read them when your app starts up. You can't do it inherently with ClickOnce in a simple way. RobinDotNet Click here to visit my ClickOnce blog!- Marked As Answer byRobinDotNetMVP, ModeratorWednesday, September 02, 2009 4:45 PM
-
| | RobinDotNet Wednesday, September 02, 2009 12:25 AM | Your question is about clickonce, try to post your question at clickonce forum for better and quick responses http://social.msdn.microsoft.com/Forums/en-US/winformssetup/threadskaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on
| | kaymaf Monday, August 31, 2009 5:11 PM | Sorry, the only way you can use query parameters with a ClickOnce application is to make the application "online-only". I don't know what kind of parameters you are trying to pass in, but is it something you could read a database for instead, or something like that? RobinDotNet Click here to visit my ClickOnce blog! | | RobinDotNet Tuesday, September 01, 2009 4:10 AM | Hi, When you say "call your application with parameters", how does the "call" happen? Do you mean some other applications may launch this app? Or just double clicking on the shortcut (in this way the parameters would be static)? Or by other means? And why exactly does your application want the parameters for? I believe with more detailed requirements, we can think of some way to solve the problem. Thanks, Jie MSDN Subscriber Support in Forum If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have any feedback, please tell us. The CodeFx ProjectMy Blog (in Simplified Chinese) | | Wang, Jie Tuesday, September 01, 2009 12:28 PM | The clickonce program I have records deviations in production. I have another program that is used to track material through the shop and record the processing information for each step. Should a piece of material deviate from the normal, I need to record that deviation and process it in a different method. It would be nice to pass over the critical information (logged in user, and some piece information) to the click once via command line parameters, have it log the person into the system (I am using LDAP to authenticate), and populate a majority of the data in the click once application and only require the user to fill in a few missing pieces of information.
This deviation program needs to work stand alone (which is the method it works in now), and it needs tight configuration control so we used click once to ensure the most current version is in place. The other pieces of software we have on the floor are already in place and would just need a minor modification to call the click once app to pass over the data. The current deviation program is 10 meg due to the report viewer control is uses, do to download the program for online use only is not practical due to the heavy burden of network traffic we already have.
I hope this clears up the requirements.
Any help is appreciated. | | katghoti Tuesday, September 01, 2009 3:13 PM | Let me clarify my original post. You can not have automatic updates, run offline/online, and use query parameters. You could try to track down the exe file and run it and pass in the parameters, but if you do that, it will not run as a ClickOnce application, i.e. won't pick up the updates. Plus, every time there IS an update, the exe file moves. You would be better off writing your own update method. All you have to do is build it into the program. Check a version number against one in a database or in a shared file (ClickOnce uses the manifest), and if the version changes, call a separate exe and shut down. The separate exe would copy the new verison over and call the application again to run. About your only other choice is to write the data you want passed in somewhere, and have the application look for the files and read them when your app starts up. You can't do it inherently with ClickOnce in a simple way. RobinDotNet Click here to visit my ClickOnce blog!- Marked As Answer byRobinDotNetMVP, ModeratorWednesday, September 02, 2009 4:45 PM
-
| | RobinDotNet Wednesday, September 02, 2009 12:25 AM | I do have another question -- why don't you just run it as online-only? RobinDotNet Click here to visit my ClickOnce blog! | | RobinDotNet Wednesday, September 02, 2009 7:50 AM | Let me clarify my original post. You can not have automatic updates, run offline/online, and use query parameters.
You could try to track down the exe file and run it and pass in the parameters, but if you do that, it will not run as a ClickOnce application, i.e. won't pick up the updates. Plus, every time there IS an update, the exe file moves.
You would be better off writing your own update method. All you have to do is build it into the program. Check a version number against one in a database or in a shared file (ClickOnce uses the manifest), and if the version changes, call a separate exe and shut down. The separate exe would copy the new verison over and call the application again to run.
About your only other choice is to write the data you want passed in somewhere, and have the application look for the files and read them when your app starts up.
You can't do it inherently with ClickOnce in a simple way.
RobinDotNet
Click here to visit my ClickOnce blog!
Based on Robin's nice suggestions, I'd like to add some ideas. You may try: 1. Addcode to your deviationapplication, each time it starts, it should do two thing: write current physical path to the exe into a registry key; call ClickOnce API to check for updates. 2. Modify you other application, when it needs to call the deviation app, it first reads the registry to get the full path of the exe and launch it with parameters. In this way, no matter how the deviation EXE is started - via ClickOnce shortcut or by the other application, it can always check for updates and also receive parameters if called by other apps. Thanks, Jie MSDN Subscriber Support in Forum If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback, please tell us.
The CodeFx Project
My Blog (in Simplified Chinese) | | Wang, Jie Wednesday, September 02, 2009 12:20 PM | Another option would be Remoting.
You don't pass the data via command line parameters. You can just launch the application, wait until it is ready, and then communicate with it via .NET Remoting, passing in whatever data. And you can encrypt the communication in this way (actually I don't like the idea passing logon info via command line).
This would need much more work though, but implemented correctly, shall be more stable and secure.
Thanks, Jie MSDN Subscriber Support in Forum If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback, please tell us.
The CodeFx Project
My Blog (in Simplified Chinese) | | Wang, Jie Wednesday, September 02, 2009 12:25 PM | Nice suggestions all, two issues:
1. Run on-line only. As I said this will put uneccessary burden on an already strained network. The EXE is 10 meg and to download would be more strain on the network. Until the network gets its upgrade, this is not an option
2. Remoting is out. Some of the programs are still running vb 6. Until they are upgraded, this is not an option, that is why the command line option was attractive.
3. It looks like I will be using a database to store the command line parameters, so when I launch the program, it will look there for processing.
Maybe in the future, Microsoft can do something about commandline parameters for offline/clickonce apps. Thanks one and all for the suggestions and help.
John | | katghoti Wednesday, September 02, 2009 1:59 PM | You might want to try this:
1) Set it up as online-only 2) Install it on a machine, run it, then exit the application. 3) Go look in the cache and see if the files are still there. (If you don't know where the cache is, post back with your OS and I'll post it.) 4) Run it again and see if it does actually download the file again.
I have a suspicion about online-only. It does download the files. I know there's supposed to be some difference, but frankly, it seems to me that the only diffs are:
1) it doesn't put it in add/remove programs, 2) there's only a shortcut on the desktop and not in the start menu, and 3) you have to be online in order to run it.
I haven't played around with it a lot, but have installed a couple of apps that are online-only, and the files DO seem to stay in the cache. So give it a try and see. If my supposition is correct, then you can use online-only without duly impacting your network.
RobinDotNet Click here to visit my ClickOnce blog! | | RobinDotNet Wednesday, September 02, 2009 4:51 PM | Nice suggestions all, two issues:
1. Run on-line only. As I said this will put uneccessary burden on an already strained network. The EXE is 10 meg and to download would be more strain on the network. Until the network gets its upgrade, this is not an option
2. Remoting is out. Some of the programs are still running vb 6. Until they are upgraded, this is not an option, that is why the command line option was attractive.
3. It looks like I will be using a database to store the command line parameters, so when I launch the program, it will look there for processing.
Maybe in the future, Microsoft can do something about commandline parameters for offline/clickonce apps. Thanks one and all for the suggestions and help.
John
Remoting is based on my assumption that your solution is pure .NET. Since this assumption is wrong, I'd looking into some native interprocess communication like named pipe. But this option might require too much work for you at this time.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback, please tell us.
The CodeFx Project
My Blog (in Simplified Chinese) | | Wang, Jie Thursday, September 03, 2009 9:13 AM |
|