Solved

Difference Between Application Reference and Shortcut

Posted on 2007-11-24
3
3,519 Views
Last Modified: 2008-02-01
I have a VB.NET app using one click deployment. Since it will not create a desktop shortcut I got the bright idea to create one on program startup. The problem is the shortcut I create doesn’t do the check for updates that the one created in the start menu does.

I see that the one automatically created is of type “Application Reference” instead of a “Shortcut”. The “Application Reference” has a General and a Summary tab. The shortcut has a General, Shortcut and Compatibility tab.

Two questions:

1)      What is an “Application Reference” and how does it differ from a shortcut?
2)      How can I make the shortcut check for downloads?

I have tried goggling, but application and reference are not words conducive to search engines.

Thanks
Randy Miller
0
Comment
Question by:randymiller
[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
  • 2
3 Comments
 
LVL 3

Expert Comment

by:ScottParker
ID: 20344357
In the Load routine of your main form put this code...
        Try
            copyShortcut("folderStartMenuShortcutIsIn", "NameOfProgram.appref-ms")
            If System.Deployment.Application.ApplicationDeployment.CurrentDeployment.IsFirstRun Then
                copyShortcut("folderStartMenuShortcutIsIn", "NameOfProgram.appref-ms")
            End If
        Catch ex As Deployment.Application.InvalidDeploymentException
            'this will always occur in debug mode. Also if user tries to run from the actual EXE
            MessageBox.Show("Please run this application from the shortcut in the Start Menu to get the automatic update feature working." & vbCrLf & vbCrLf & "You can create a desktop shortcut from that particular shortcut if you like.", "Alert")
           messagebox.show("Error with shortcut and InvalidDeploymentException")
            End
        Catch ex As Exception
            messagebox.show("Error with shortcut and InvalidDeploymentException")
            End
        End Try

Then add this function...
    Public Shared Sub copyShortcut(ByVal manufacturerName As String, ByVal shortcutFileName As String)
        'the easy way for VB programmers *
        Dim desktopPath As String = My.Computer.FileSystem.SpecialDirectories.Desktop + "\" + shortcutFileName
        Dim startPath As String = My.Computer.FileSystem.SpecialDirectories.Programs + "\" + manufacturerName + "\" + shortcutFileName
        Try
            System.IO.File.Copy(startPath, desktopPath, True)
        Catch e As Exception
            Throw e
        End Try
    End Sub
0
 

Author Comment

by:randymiller
ID: 20344428
Different approach, I like the idea.

Do you know what an "Applicatoin Reference" is?
0
 
LVL 3

Accepted Solution

by:
ScottParker earned 500 total points
ID: 20344467
the applciation reference is that "NameOfProgram.appref-ms" section.

The following link explains it better then I could.  (Even though its on a more advanced topic)

http://www.codeproject.com/useritems/ClickOnceLauncher.asp?df=100&forumid=308890&exp=0&select=1517755&tid=1513516
0

Featured Post

Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

Question has a verified solution.

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

This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

623 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