Home All Groups Group Topic Archive Search About

Adding desktop shortcuts and start program entries

Author
30 Jun 2005 6:13 AM
Jack Russell
Can anyone tell me if there is a .net way of doing these things.

I have VB6 code but assume there is a new way.

Thanks

Author
30 Jun 2005 6:23 AM
Cor Ligthert
Jack,

Do you mean, keys (that goes the same)?

Or do you mean deployment?.

Or something else?

Cor
Author
30 Jun 2005 7:17 AM
Peter Proost
Hi you can use this to create a shortcut on the desktop:

Private Sub CreateShort()
        Dim m_Shortcut As ShellShortcut
        m_Shortcut = New ShellShortcut(Environment.GetFolderPath
_(Environment.SpecialFolder.DesktopDirectory) & "\YourApp.lnk")
        With m_Shortcut
            .Path = "Path to your app"
            .WorkingDirectory = "path to the working directory"
            .Description = "Description"
            .Save()
        End With

    End Sub

hth

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

Show quoteHide quote
"Cor Ligthert" <notmyfirstn***@planet.nl> schreef in bericht
news:#QXjhxTfFHA.3256@TK2MSFTNGP12.phx.gbl...
> Jack,
>
> Do you mean, keys (that goes the same)?
>
> Or do you mean deployment?.
>
> Or something else?
>
> Cor
>
>
Author
30 Jun 2005 12:33 PM
Herfried K. Wagner [MVP]
Peter,

"Peter Proost" <pproost@nospam.hotmail.com> schrieb:
> Hi you can use this to create a shortcut on the desktop:
>
> Private Sub CreateShort()
>        Dim m_Shortcut As ShellShortcut

Where did you find the 'ShellShortcut' class?

BTW:  I am just curious why you are using the 'm_' prefix for a local
variable ;-).

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
30 Jun 2005 12:45 PM
Peter Proost
ooops, I should have posted this link:

http://www.msjogren.net/dotnet/eng/samples/dotnet_shelllink.asp

My bad

Greetz Peter, and as for the m_prefix, there is no logical explanation
except if I'm one of the reasons why the universe is winning (see my footer)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.


Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht
news:OakPn$WfFHA.576@TK2MSFTNGP15.phx.gbl...
> Peter,
>
> "Peter Proost" <pproost@nospam.hotmail.com> schrieb:
> > Hi you can use this to create a shortcut on the desktop:
> >
> > Private Sub CreateShort()
> >        Dim m_Shortcut As ShellShortcut
>
> Where did you find the 'ShellShortcut' class?
>
> BTW:  I am just curious why you are using the 'm_' prefix for a local
> variable ;-).
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>
Author
30 Jun 2005 12:48 PM
Peter Proost
forgot to add a big :-)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

Show quoteHide quote
"Peter Proost" <pproost@nospam.hotmail.com> schreef in bericht
news:#5cOVGXfFHA.3656@TK2MSFTNGP09.phx.gbl...
> ooops, I should have posted this link:
>
> http://www.msjogren.net/dotnet/eng/samples/dotnet_shelllink.asp
>
> My bad
>
> Greetz Peter, and as for the m_prefix, there is no logical explanation
> except if I'm one of the reasons why the universe is winning (see my
footer)
>
> --
> Programming today is a race between software engineers striving to build
> bigger and better idiot-proof programs, and the Universe trying to produce
> bigger and better idiots. So far, the Universe is winning.
>
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht
> news:OakPn$WfFHA.576@TK2MSFTNGP15.phx.gbl...
> > Peter,
> >
> > "Peter Proost" <pproost@nospam.hotmail.com> schrieb:
> > > Hi you can use this to create a shortcut on the desktop:
> > >
> > > Private Sub CreateShort()
> > >        Dim m_Shortcut As ShellShortcut
> >
> > Where did you find the 'ShellShortcut' class?
> >
> > BTW:  I am just curious why you are using the 'm_' prefix for a local
> > variable ;-).
> >
> > --
> >  M S   Herfried K. Wagner
> > M V P  <URL:http://dotnet.mvps.org/>
> >  V B   <URL:http://classicvb.org/petition/>
> >
>
>
Author
30 Jun 2005 7:51 AM
Jack Russell
Cor Ligthert wrote:
> Jack,
>
> Do you mean, keys (that goes the same)?
>
> Or do you mean deployment?.
>
> Or something else?
>
> Cor
>
>
I am thinking of writing my own "deployment" program in .net since I can
  get the setup bootstrap to install dotnetfx and hopefully start my
program . So I want to set up a desktop shortcut to the program that I
will install and add a group and shortcut to the Start, All programs list.

With VB6 I just modified setup1 and I would do the same here if I could
but it seems they do not give us the source of the windows installer and
even if they did I doubt that it would be in VB.

After typing all this I realise I have not quite worked out how to get
the bootstrap to start my program!

Jack
Author
30 Jun 2005 12:32 PM
Herfried K. Wagner [MVP]
"Jack Russell" <ja***@norubbish.tpg.com.au> schrieb:
> Can anyone tell me if there is a .net way of doing these things.

Where/when do you want to do that?  Typically a setup program is used to add
start menu entries and desktop shortcuts.  VS.NET's setup editor supports
specifying such shortcuts.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>