 |
|
 |
What can i do if i want to start the aplication at system startup?
|
|
|
|
 |
|
 |
Try putting it in the windows startup folder.
Shawn Weisfeld
C# MVP
http://www.shawnweisfeld.com
|
|
|
|
 |
|
 |
If .Net Framework 3.5 SP1 is installed, then in Offline mode, you can use Process.Start to launch another ClickOnce application using its URL (and also pass parameters to it). For instance, Process.Start("http://somelocation/someapp.application?myparam1=somevalue")
HTH,
Hardik
|
|
|
|
 |
|
 |
install the application on a test machine from it's deployment url. open the application.reference file in the start menu using notepad, i.e: http://xxx.com/deploymentURL/appname.application#appname.application, Culture=neutral, PublicKeyToken=59a31195e50ec799, processorArchitecture=msil You can jam that string into *any* programming language to start the process. For example: C++: ShellExecuteA(0,"open","http://xxx.com/deploymentURL/appname.application#appname.application, Culture=neutral, PublicKeyToken=59a31195e50ec799, processorArchitecture=msil",NULL,NULL,SW_HIDE); VB6: Shell("http://xxx.com/deploymentURL/appname.application#appname.application, Culture=neutral, PublicKeyToken=59a31195e50ec799, processorArchitecture=msil") etc etc.
|
|
|
|
 |
|
 |
I distribute my programs using a UNC not a URL, should the code work the same? I have tried it and I get a path not found error?
|
|
|
|
 |
|
 |
Is there a way to install ClickOnce silent, without any user-popups?
|
|
|
|
 |
|
 |
Found the solution (part of it), it is very complex.
You need to set the application certificate so the popup will not appear:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2215832&SiteID=1
Than you can use the InPlaceHostingManager to "push" the application to the clinet computer:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2275598&SiteID=1
|
|
|
|
 |
|
 |
Hi saw1234.
I found a guy speaking same lauguage now . Actually, I posted code below at
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=6&SiteID=1, but no one agrees with me nor answered my question. I was told that it is not offical way for ClickOnce bla bla. I was wondering if you have any idea about code below.
The question is, I found the shotcut is actually a unicode text file indeed. So I create it on fly and put it in a tmp foler, then run it. It works fine, but I'm just not able to catch the Exited event. While if I can actually catch the event if the process is a standard along exe. Any suggestion would be appreciated.
Process myClickOnce;
private void CheckDownload()
{
myClickOnce = new Process();
myClickOnce.EnableRaisingEvents = true;
myClickOnce.StartInfo = new ProcessStartInfo(@"c:\temp\myTest.appref-ms");
//myClickOnce.StartInfo = new ProcessStartInfo("notepad.exe");
myClickOnce.Exited += new EventHandler(myClickOnce_Exited);
myClickOnce.Start();
}
void myClickOnce_Exited(object sender, EventArgs e)
{
MessageBox.Show("Download finished");
}
|
|
|
|
 |
|
 |
Hey stevendonline i realize this is about a year late but try this
(im a VBer so take what you can out of this)
in vb i would go
Public Sub New()
Dim Proc as New Process
Dim Si as New StartInfo
Si.FileName = "C:\Temp\Mytest....."
Proc.StartInfo = Si
'--------
AddHandler Proc.Exited, AddressOf Proc_Exit
'--------
Proc.Start
End Sub
Sub Proc_Exit(sender as object, e as System.EventArgs)
'CODE HERE
End sub
Daniel Rolfe
-------------
Lead Software Developer
VB 2005 ASP ADO - .NET2
|
|
|
|
 |
|
 |
But how the heck are you adding the application reference?
I tried a number of ways of doing this and mostly it just causes an error when I just try to publish the launcher app.
I did get it to function, somewhat, when I just used Process.Start("url_to_.application"); and no reference but that caused the browser to open, momentarilly in IE 7 and permanently with FireFox. Does your version of this article open a browser?
|
|
|
|
 |
|
 |
No, by including the application reference file from the start menu the click once application opens without calling a browser. The trick is doing the Process.Start on the application reference (*.appref-ms) file not on the URL.
Shawn Weisfeld
President Orlando .NET Users Group
http://www.onetug.org
|
|
|
|
 |
|
 |
Okay I got you now and it works pretty well.
Might be clearer if you altered the article to indicate that the application reference is the shortcut found in
C:\Documents and Settings\username\Start Menu\Programs\Manfacturer Name\ApplicationName.appref-ms
The .appref-ms doesn't show and being a new file type on the system some might not have become aquainted with this type of shortcut/link file.
Also one needs to be sure to add a reference to System.Diagnostics to use Process.Start(@"path\to\AppRef.appref-ms");
I used "using System.Diagnostic;" in the form.cs file.
Works well, cool idea I need to see how it can be further extended.
Thanks
-- modified at 8:07 Thursday 28th September, 2006
|
|
|
|
 |
|
 |
I appreciate your sharing your work, but I am left with a real sense of curiousity about what are the advantages or uses of launching a ClickOnce application in this way from another ClickOnce application.
If you could say a little more about why you developed this, and what class of problems it solves, or what it facilitates, or makes possible, that would be appreciated.
best, Bill
"The greater the social and cultural distances between people, the more magical the light that can spring from their contact." Milan Kundera in Testaments Trahis
|
|
|
|
 |
|
 |
This technique was designed after a client requested the ability to launch a click once application from another click once application. This technique is designed to meet this requirement. The only way (to the best of my knowledge) too reliably, dynamically, launch an installed click once application, off line, is through this process, thus meeting the clients requirements. If your clients have this requirement then feel free to use this technique, but if they do not then you do not need this technique. Did this answer your question?
Shawn Weisfeld
President Orlando .NET Users Group
http://www.onetug.org
|
|
|
|
 |
|
 |
"Did this answer your question?"
No.
Did you ever ask your "client" why they required this ?
Did you explain to your client that ClickOnce publishing gives you the option to publish in an "online-only" mode (no Start menu entry on your local machine) or in an offline mode (Start menu entry on your local machine, checks for updates when on-line, and automatically updates the app or its data files or resources automatically with some user prompting depending on settings).
Perhaps you are describing what is necessary to 'shell' an offline-only mode ClickOnce application remotely from another process ?
I assume, but have not personally tried, that you could make an offline-only
ClickOnce app scriptable, set to startup automatically with Windows, subject to start-up by Windows Scheduler. Perhaps the last alternative would require your technique of 'de-referencing' the shortcut ?
best, Bill
"The greater the social and cultural distances between people, the more magical the light that can spring from their contact." Milan Kundera in Testaments Trahis
|
|
|
|
 |
|
 |
I did explain the capabilities of ClickOnce to the client, but to the best of my knowledge this is the only technique to start a ClickOnce application from another ClickOnce application. There goal was to make a completely off line application that could be started from another completely offline application. Some might call this a ‘shell’, and this technique would be useful for scriptable situations.
I am not sure you mean by ‘de-referencing’ the shortcut.
Shawn Weisfeld
President Orlando .NET Users Group
http://www.onetug.org
|
|
|
|
 |
|
 |
hi, is there a way we could pass a parameter from one clickonce application to another application and then launch it? just wondering if it is possible....
|
|
|
|
 |
|
 |
The easy way would be by using the query string (http://msdn2.microsoft.com/en-us/library/ms172242.aspx).
Shawn Weisfeld
President Orlando .NET Users Group
http://www.onetug.org
|
|
|
|
 |
|
 |
so instead of using the application reference you mentioned on your example above i should use the the url of the clickonceclient application with a parameter?
I already know how to use parameter when launching a clickonce application. but my problem is how to launch a clickonce application from another clickonce application but the first application should pass parameter to the other clickonce application. Hope you could give me a step by step way to do this.. thanks!!!
|
|
|
|
 |
|
 |
Ahh, I understand now, you want to use my technique of launching a click once app from another click once app and you want to be able to pass the second app some information from the first application. I don’t know of any way this is supported with click once. My guess is that you are going to have to resort to the traditional methods of inter-processes communication (i.e. write the information to a database table or file and have the new app read that when it launches, or send a message using WCF etc from one process to another, etc.)
Shawn Weisfeld
President Orlando .NET Users Group
http://www.onetug.org
|
|
|
|
 |