Desktop Shortcut problem

Got a problem you cannot solve? Try here.
wxperson99
Posts: 63
Joined: Sun Jul 13, 2014 3:28 pm

Desktop Shortcut problem

Postby wxperson99 » Sun Mar 13, 2016 11:17 am

HI... I will try to keep this succinct as possible.

I have users who had installed a prior version of my application with WISE.

I have an installation which will update their system now using IA.

When I create shortcuts (hoping to duplicate what they already have for uninstall purposes) I end up with a shortcut.lnk in both the users desktop and the public desktop... so it appears I have 2 sets of the same desktop shortcuts.

Wise created the original USER desktop shortcuts and Installaware creates the PUBLIC ones.

I figure I have 2 options but for now want to examine #2.

1. Delete the user desktop shortcuts during the IA install.
or
2. Change the IA $desktopdir$ to the users desktop location. Right now IA pointing to the public desktop.


If I choose to do #2.... HOW DO I GET THE DESKTOPDIR variable to show the users desktop location??

The code I have currently have in the IA routine related to DESKTOPDIR are shown below (both copy text and IA copy)

I am still new to IA and could really use some help.

Thanks,

George

*** Code below

Get Folder Location System->Desktop Directory into DESKTOPDIR (get for ALL users is NOT checked)
.
.
Read Registry Key HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Desktop into DESKTOPDIR
.
.
Create Shortcut $DESKTOPDIR$\Hurrtrak EMPro to $TARGETDIR$\hurrtrak.exe

OR

~InstallAware Clipboard Data~
~Get Folder Location~
~{CCEB9F18-4EF5-410E-B3FB-6DB2584B2AA6}~
~DESKTOPDIR~
~17~
~FALSE~

~InstallAware Clipboard Data~
~Read Registry~
~{0874967A-C26E-4090-A5B3-849D1667A245}~
~DESKTOPDIR~
~1~
~Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders~
~Desktop~

~InstallAware Clipboard Data~
~Create Shortcut~
~{A0B5DE4B-41B1-4A5D-8CA6-487859978166}~
~$TARGETDIR$\hurrtrak.exe|FALSE~
~Hurrtrak EMPro~
~$DESKTOPDIR$|FALSE~
~~
~~
~|FALSE~
~|FALSE~
~0|~
~0|~

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Desktop Shortcut problem

Postby FrancescoT » Mon Mar 14, 2016 11:20 am

Dear George,

it's not full clear to me why you want to proceed in that way.
Why do you want to keep the other WISE installation? if this gets uninstalled you don't need to replace/delete the existing shortcut.

In addition, you should not alter a shortcut created by another installer. This may cause an error with that installer if you try later to uninstall the app.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

wxperson99
Posts: 63
Joined: Sun Jul 13, 2014 3:28 pm

Re: Desktop Shortcut problem

Postby wxperson99 » Mon Mar 14, 2016 1:22 pm

Thanks for the advice.

I still have the following question.

How do I get the $DESKTOPDIR$ variable to show the users desktop location not the PUBLIC one?

The code for this variable in my script was shown in my original email.

Thanks...

George

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Desktop Shortcut problem

Postby FrancescoT » Mon Mar 14, 2016 2:26 pm

Dear George,

the DESKTOPDIR should be retrieved as follow;

Code: Select all

if Variable ALLUSERS Equals TRUE
  Get Common Folder Location System->Desktop Directory into DESKTOPDIR
else
  Get Folder Location System->Desktop Directory into DESKTOPDIR
end

Code: Select all

~InstallAware Clipboard Data~
~End~
~{D3E728CA-2945-4AD2-8BAE-4C3F78B56D86}~
~Get Folder Location~
~{FC0675C9-8D69-4AF5-835D-32AEBB6BA167}~
~DESKTOPDIR~
~17~
~FALSE~
~Set Variable~
~{21CE164A-2DB2-4210-89DE-695BDF554890}~
~SHORTCUTFOLDER~
~$SHORTCUTFILES$\$STARTMENU$~
~Else~
~{782C9E00-FB73-40A6-8E5C-94C7DD9A8D5E}~
~Get Folder Location~
~{3E0A1CD1-64CD-4404-8015-125FE0E67B1E}~
~DESKTOPDIR~
~17~
~TRUE~
~Set Variable~
~{CC19A143-B775-4C8B-B82F-67453D228546}~
~SHORTCUTFOLDER$MYAH$MYAH$FALSE~
~$SHORTCUTFILESALL$\$STARTMENU$~
~If~
~{ED9089CB-C5C8-425F-908A-EC38E615CA54}~
~ALLUSERS~
~0~
~TRUE~
~FALSE~

With the above snippet; if the the installation is executed PER-MACHINE (ALL-USERS), the "Get Common Folder Location" will attempt to obtain the location of the pre-defined folder that is shared by all users of the target system (Get for All Users = TRUE). Otherwise, the location of the pre-defined folder for the current user will be acquired (Get for All Users = FALSE).

Code: Select all

Create Shortcut $DESKTOPDIR$\MyApp to $TARGETDIR$\MyFile.Exe

Code: Select all

~InstallAware Clipboard Data~
~Create Shortcut~
~{C98D24AC-9867-48BD-9C96-1201FAAC985A}~
~$TARGETDIR$\MyFile.Exe|FALSE~
~MyApp~
~$DESKTOPDIR$|FALSE~
~My Test app~
~~
~|FALSE~
~|FALSE~
~|~
~0|~


Hope this helps you.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

wxperson99
Posts: 63
Joined: Sun Jul 13, 2014 3:28 pm

Re: Desktop Shortcut problem

Postby wxperson99 » Tue Mar 15, 2016 9:01 am

I believe it will.

Thanks!

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Desktop Shortcut problem

Postby FrancescoT » Tue Mar 15, 2016 1:16 pm

:D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 164 guests