PDA

View Full Version : Question about shortcut



NewsArchive
05-11-2009, 01:35 AM
Hi
I have a program, vpfaktura.exe , wich normally installs to c:\faktura
making a shortcut on the desktop and in the start menu. Both set to Replace
existing shortcut.
I have a problem if my customer installs an extra copy (they are allowed to
do so) in f.ex. c:\fakturaExtra . In this case the shortcut for
c:\faktura\vpfaktura.exe is simply changed to c:\fakturaExtra\vpfaktura.exe
instead of making an extra shortcut. I get some very worried calls from
customers thinking all their data is gone.
If they update the standard program (existing programname, existing
programpath) there should not be made an extra shortcut, only when
installing in another position (existing programname, new programpath).
Any thought how i do this ?

--
Kind regards / Med Venlig Hilsen
Viggo Poulsen
Vipilon ApS
www.vipilon.dk

NewsArchive
05-11-2009, 01:36 AM
A Shortcut is nothing more (or less) than a file. So if the customer
installs an "extra" copy of the program and the Shortcut name is identical,
then of course Windows replaces this shortcut (file).

You have to give a unique name to the Shortcut to provide multiple
Shortcuts.

Hope this helps.

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-11-2009, 01:36 AM
In Vista i can copy/paste a shortcut on the desktop and it gets the same
name. = two shortcuts with same name, pointing at the same file. A little
strange.
Could I make something like this :
If installdir <> 'c:\faktura' then shortcutname = installdir& 'vP Faktura'
?

--
Kind regards / Med Venlig Hilsen
Viggo Poulsen
Vipilon ApS
www.vipilon.dk

NewsArchive
05-11-2009, 01:37 AM
No, you can't -- and not strange at all. You have it in different profiles
if you do this. Try to make a "third" (not really) copy of this Shortcut
and you'll see what I mean. The "third" one will have a "Copy" addition and
if you do it again, "Copy (2)"

The original one (installed by SetupBuilder) is located in
Users\Public\Desktop (hidden folder by default). If you make a "copy", they
will end in Users\<username>\Desktop. A completely different location. In
other words, it's not the SAME file ;-)

Does this help?

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-11-2009, 01:37 AM
By the way, when I said "No, you can't" I was referring to your "In Vista i
can copy/paste a shortcut on the desktop and it gets the same name"
statement.

Of course, you can name your Shortcut whatever you want (and variables are
supported).

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-11-2009, 01:38 AM
Yes you are right (you knew that, right ?). Should it not be possible to
test if Users\Public\Desktop\vp faktura..lnk exists, and use another name if
it does exist ?

Best regards
Viggo Poulsen

NewsArchive
05-11-2009, 01:38 AM
Hi Viggo,

> Yes you are right (you knew that, right ?). Should it not be possible
> to test if Users\Public\Desktop\vp faktura..lnk exists, and use another
> name if it does exist ?

Yes, you can do this without any problem. Just check if the .lnk already
exists. If this is the case, give another name.

You can even do this in a simple LOOP to append a unique number to your
Shortcut name.

BTW, if you allow multiple installations of your product, make sure the
Add/Remove Panel is handled correctly. Otherwise, you can only uninstall
one instance of your product via Add/Remove Panel.

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-11-2009, 01:39 AM
Viggo,

> Yes you are right (you knew that, right ?). Should it not be possible
> to test if Users\Public\Desktop\vp faktura..lnk exists, and use another
> name if it does exist ?

See attached demo project and source code snippet. It creates a unique
Desktop Shortcut name that links to Notepad.exe.

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-11-2009, 01:40 AM
Thank you.

Viggo Poulsen