Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Difference Between Application Reference and Shortcut

Posted on 2007-11-24
3
Medium Priority
?
3,669 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
  • 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
This article is about my experience upgrading my consulting machine to Windows 10 Version 1709 (The Fall 2017 Creator Update)
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
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…

926 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