Solved

launch click-once application from another program

Posted on 2007-11-21
4
2,251 Views
Last Modified: 2013-11-26
I am trying to determine how to launch a VB.NET application which was installed using Click-Once deployment from another application.  Thus far, the only relevant information I have been able to find was in the following article:

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22746601.html?sfQueryTermInfo=1+%22click+onc%22+anoth+applic+from+open+program

However, when using the method shown there the application does not open but instead tries to install itself again.  

I need to know how to open the Click-Once application from other programs as it is part of an inter-related group of programs I have been developing.
0
Comment
Question by:iscontact
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 500 total points
ID: 20336445
When an application is installed, the installer may or may not remain on the pc. In most cases, it is not needed to run the application.

So, for the time being, ignore the installer.

Instead, look at the shortcuts produced by the installation procedure. Normally these will end up on 1 of 2 places - your start menu or the "all users" start menu.

If you go to a command prompt and type SET and then press enter, you will see environment variables such as ...

ALLUSERSPROFILE
USERPROFILE

These point to the directories responsible for holding the profiles.

So, looking for the location of say, Internet Explorer (Start | All Programs | Internet Explorer) you would look for the shortcut in ...

"%USERPROFILE%\Start Menu\Programs\Internet Explorer.lnk"

So, running this program via an appropriate shell exec type command, will run the program.

You can even pass parameters!

Type this at the command prompt (all 1 line) ...

"%USERPROFILE%\Start Menu\Programs\Internet Explorer.lnk" http://tinyurl.com/3avvyp

So, something like this should work ...

Shell("""%USERPROFILE%\Start Menu\Programs\Internet Explorer.lnk"" http://tinyurl.com/3avvyp", vbMaximizedFocus)

I'm no VB expert, so I you may need to play with the exact syntax.

Of course, if you don't find the lnk you want in USERPROFILE, then you will need to look in ALLUSERSPROFILE.

0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 20336462
http://msdn2.microsoft.com/en-us/library/142dbbz4(VS.80).aspx

"The application is added to the user's Start menu and to the Add/Remove Programs group in the Control Panel. Unlike other deployment technologies, nothing is added to the Program Files folder, the registry, or the desktop, and no administrative rights are required for installation"

So, only the shortcut to the program is possible.  But it suggests that every time the program is launched it is installed temporarily.
0
 

Author Comment

by:iscontact
ID: 20352637
Thanks for the help.  This helped me to get the application to launch.  For reference, the command line I used is as follows:

Dim runningProc As System.Diagnostics.Process
runningProc = New System.Diagnostics.Process

'Do not receive an event when the process exists
runningProc.EnableRaisingEvents = False

runningProc.Start("c:\Documents and Settings\" & UserName & "\Start Menu\AppName.appref-ms")

Note that the link is actually an application reference and not a link.
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 20356346
Yes, if the shortcut is to, say, an Excel spreadsheet or a bat file or anything that is either a "program" or has an extension which is registered with a program, then running it via the shell executor will do the job.

I'm unsure why you are using System.Diagnostics.Process, it doesn't "sound" like the sort of thing to run a program, but I'm not VB.NET expert ...

Glad to have helped!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question