create desktop shortcut when app installed w/P&D installer for XP,Vista,W7 
Author Message
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7

I want to modify the installer to create a desktop shortcut when a
program is installed. I found this discussion
http://www.*-*-*.com/
that explains, "by adding just 4 lines of code, the Packaging &
Deployment Wizard and Setup1.vbp can be easily modified to create
Desktop shortcuts, as well as Start Menu shortcuts."
http://www.*-*-*.com/
I was wondering how this looked to people here, and if there are other
approaches that might be better.


Fri, 22 Feb 2013 10:35:15 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7

Quote:
>I want to modify the installer to create a desktop shortcut when a program
>is installed. I found this discussion
> http://www.vbforums.com/showthread.php?t=451311
> that explains, "by adding just 4 lines of code, the Packaging & Deployment
> Wizard and Setup1.vbp can be easily modified to create Desktop shortcuts,
> as well as Start Menu shortcuts."
> http://www.freevbcode.com/ShowCode.asp?ID=3650
> I was wondering how this looked to people here, and if there are other
> approaches that might be better.

I would recommend that you use Inno Setup ANSI version, which doesn't
require runtime, and works from Windows 95 to 7. It already natively support
many things you would need to modify PDW for, such as showing license files,
and adding keys and values to anywhere in the registry, and so on. Just run
the wizard and fill the information, then check this how to article:

http://www.jrsoftware.org/iskb.php?vb
http://www.jrsoftware.org/isinfo.php



Fri, 22 Feb 2013 10:49:12 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7
See here for two versions of modified PDW that
include updates like Desktop shortcut, app path
folder creation, permission changing on folders, etc:

http://www.jsware.net/jsware/vbcode.php5

  The thread you linked to shows two ways of
creating a shortcut. One uses a function from
vb6stkit.dll, which is OK *if* you can get it to
work. The other is a hokey method using wscript.shell
that *should not* be used. The files linked above
use the shelllnk.tlb for VB.

|I want to modify the installer to create a desktop shortcut when a
| program is installed. I found this discussion
| http://www.vbforums.com/showthread.php?t=451311
| that explains, "by adding just 4 lines of code, the Packaging &
| Deployment Wizard and Setup1.vbp can be easily modified to create
| Desktop shortcuts, as well as Start Menu shortcuts."
| http://www.freevbcode.com/ShowCode.asp?ID=3650
| I was wondering how this looked to people here, and if there are other
| approaches that might be better.
|



Fri, 22 Feb 2013 11:01:12 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7
Just to expand on that last post a bit...

 Setup1 from the PDW is an interesting project
that includes all of the functionality needed for
an installation. It's really whatever you want it
to be. But you need to be willing to spend a
little time getting familiar with it.

 Also note that when making changes you should
take care to log them in the uninstall log. The code
you linked to doesn't do that, but it's easy to do.
The functions are in vb6stkit.dll and they're amply
demonstrated in the setup1 code. If you look at
the code in the link I posted above there's a function
called DoDeskLink. It includes these lines:

NewAction GstrKEY_PRIVATEFILE, QUOTEMARK & sLNKPath & QUOTEMARK
AddActionNote "Desktop link created."
CommitAction

Those lines write to the ST6UNST.LOG file in the
program folder, which is used for uninstall. They
write lines something like:

ACTION: PrivateFile: "C:\Documents and Settings\All
Users\Desktop\SomeProgram.LNK"
(Desktop link created.)

  With the CommitAction call those lines are written to
the log. So when your program is uninstalled the Desktop
shortcut will be removed. You can do the same for
custom Registry settings, folder creation, etc. Just log
them and they'll be undone at uninstall. (See any uninstall
log file from a VB6 install to see how that works.)

  The No-Setup.exe version I linked to also has a
simple class for setting permissions on files/folders/
Registry keys.

    So you can customize your install in
all sorts of ways, and still have it cleanly removed
by the standard PDW uninstaller. But be careful with
vb6stkit.dll. It's specially designed for the PDW.
OSfCreateShellLink may work OK, but you need to
test it. The shelllnk.tlb method is probably safer.
An example of the kind of quirks you'll find with
vb6stkit.dll: It has a function ExtractFileFromCab that
looks quite handy. But if I remember correctly that
function is actually hardcoded to look for the CAB
in the Windows folder (!), because the PDW normally
moves the CAB file there before proceeding with install.



Fri, 22 Feb 2013 11:43:27 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7
On Sun, 5 Sep 2010 23:43:27 -0400, "Mayayana"

Quote:

>The shelllnk.tlb method is probably safer.

Agreed.   Access Developers have been using my Auto FE Updater utility
since Version 1.3 - 2002/04/10 to create shortcuts which uses the
shellnk.tlb method.    There have been thousands of downloads per
year.   And I've never had one complaint about my utility creating
shortcuts ranging from Windows 98 to Windows 7.

Well, ok, I've added a few features over the years and Win Vista made
the Common Desktop to be updateable only with admin privileges but
I've never had one complaint about the basic functionality.  

Tony

--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
  updated see http://www.autofeupdater.com/



Fri, 22 Feb 2013 12:05:30 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7
| >The shelllnk.tlb method is probably safer.
|
| Agreed.   Access Developers have been using my Auto FE Updater utility
| since Version 1.3 - 2002/04/10 to create shortcuts which uses the
| shellnk.tlb method.    There have been thousands of downloads per
| year.

 I've used it for years, too. And it's the official
MS approach for VB. (If something marked
"unsupported" can be considered official.)

  Then again, you're the guy who made sense out
of Wix in a matter of hours, so you're clearly no
mere mortal. :)



Fri, 22 Feb 2013 22:17:47 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7
On Mon, 6 Sep 2010 10:17:47 -0400, "Mayayana"

Quote:

>  Then again, you're the guy who made sense out
>of Wix in a matter of hours, so you're clearly no
>mere mortal. :)

<blush>  Thanks.  But all I needed to do was install one DLL using an
MSI file.  And the tutorial handled all my requirements so I just
followed the instructions and cut and pasted as appropriate.    

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
  updated see http://www.autofeupdater.com/



Sat, 23 Feb 2013 04:07:10 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7


:
:  Then again, you're the guy who made sense out
: of Wix in a matter of hours, so you're clearly no
: mere mortal. :)

I had to see what that was all about - Wix.  What a cool package.  I love
the cooresponding candle names.  Don't get me wrong, I am Inno loyal, but I
need to check this out too.  Thanks!



Sat, 23 Feb 2013 04:35:49 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7

Quote:

>:  Then again, you're the guy who made sense out
>: of Wix in a matter of hours, so you're clearly no
>: mere mortal. :)

>I had to see what that was all about - Wix.  What a cool package.  I love
>the cooresponding candle names.  Don't get me wrong, I am Inno loyal, but I
>need to check this out too.  Thanks!

AFAIK Inno can't produce MSI files.  And I wanted MSI files because I
think that IT admins will be more comfortable installing MSI files
especially remotely.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
  updated see http://www.autofeupdater.com/



Sat, 23 Feb 2013 06:33:03 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7

Quote:
> Just to expand on that last post a bit...

>   Setup1 from the PDW is an interesting project
> that includes all of the functionality needed for
> an installation. It's really whatever you want it
> to be. But you need to be willing to spend a
> little time getting familiar with it.

>   Also note that when making changes you should
> take care to log them in the uninstall log. The code
> you linked to doesn't do that, but it's easy to do.
> The functions are in vb6stkit.dll and they're amply
> demonstrated in the setup1 code. If you look at
> the code in the link I posted above there's a function
> called DoDeskLink. It includes these lines:

> NewAction GstrKEY_PRIVATEFILE, QUOTEMARK&  sLNKPath&  QUOTEMARK
> AddActionNote "Desktop link created."
> CommitAction

> Those lines write to the ST6UNST.LOG file in the
> program folder, which is used for uninstall. They
> write lines something like:

> ACTION: PrivateFile: "C:\Documents and Settings\All
> Users\Desktop\SomeProgram.LNK"
> (Desktop link created.)

>    With the CommitAction call those lines are written to
> the log. So when your program is uninstalled the Desktop
> shortcut will be removed. You can do the same for
> custom Registry settings, folder creation, etc. Just log
> them and they'll be undone at uninstall. (See any uninstall
> log file from a VB6 install to see how that works.)

>    The No-Setup.exe version I linked to also has a
> simple class for setting permissions on files/folders/
> Registry keys.

>      So you can customize your install in
> all sorts of ways, and still have it cleanly removed
> by the standard PDW uninstaller. But be careful with
> vb6stkit.dll. It's specially designed for the PDW.
> OSfCreateShellLink may work OK, but you need to
> test it. The shelllnk.tlb method is probably safer.
> An example of the kind of quirks you'll find with
> vb6stkit.dll: It has a function ExtractFileFromCab that
> looks quite handy. But if I remember correctly that
> function is actually hardcoded to look for the CAB
> in the Windows folder (!), because the PDW normally
> moves the CAB file there before proceeding with install.

I decided to take the plunge and try Inno Setup, I have to say Inno is a
really impressive program. 31 lines in the script let me install the VB
support files and my program files and custom folders, and it gives the
user the options of creating desktop or quicklaunch shortcut icons, with
full uninstall; really impressive program.


Sat, 23 Feb 2013 13:50:26 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7

Quote:



> :
> :  Then again, you're the guy who made sense out
> : of Wix in a matter of hours, so you're clearly no
> : mere mortal. :)

> I had to see what that was all about - Wix.  What a cool package.  I love
> the cooresponding candle names.  Don't get me wrong, I am Inno loyal, but I
> need to check this out too.  Thanks!

Yeah, I have an Inno and a WiX installer side by side for my toy project
at home.
Note really done much with WiX yet though.
Inno still looks nicer out the box :p

--

i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)



Sat, 23 Feb 2013 15:39:40 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7

Quote:
>I want to modify the installer to create a desktop shortcut when a program
>is installed. I found this discussion
> http://www.vbforums.com/showthread.php?t=451311
> that explains, "by adding just 4 lines of code, the Packaging & Deployment
> Wizard and Setup1.vbp can be easily modified to create Desktop shortcuts,
> as well as Start Menu shortcuts."
> http://www.freevbcode.com/ShowCode.asp?ID=3650
> I was wondering how this looked to people here, and if there are other
> approaches that might be better.

I didn't follow the links, but I want to urge you to ASK the user for
permission to install a shortcut onto the desktop. I personally despise
installers that do this without asking, and have actually denied everyone
the ability to create files/folders and/or write data to both my personal
and the All Users desktop.

If you don't ask for permission (due to technical reasons--or just plain
laziness), please make sure that your installer doesn't FAIL simply because
it can't create a shortcut; just report an error and move along. The only
thing worse than not asking permission is acting like that desktop shortcut
is the most important thing in the world. (And believe me, there are
installers out there like that.)



Sat, 23 Feb 2013 23:50:28 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7

Quote:


>> I want to modify the installer to create a desktop shortcut when a program
>> is installed. I found this discussion
>> http://www.vbforums.com/showthread.php?t=451311
>> that explains, "by adding just 4 lines of code, the Packaging&  Deployment
>> Wizard and Setup1.vbp can be easily modified to create Desktop shortcuts,
>> as well as Start Menu shortcuts."
>> http://www.freevbcode.com/ShowCode.asp?ID=3650
>> I was wondering how this looked to people here, and if there are other
>> approaches that might be better.

> I didn't follow the links, but I want to urge you to ASK the user for
> permission to install a shortcut onto the desktop. I personally despise
> installers that do this without asking, and have actually denied everyone
> the ability to create files/folders and/or write data to both my personal
> and the All Users desktop.

> If you don't ask for permission (due to technical reasons--or just plain
> laziness), please make sure that your installer doesn't FAIL simply because
> it can't create a shortcut; just report an error and move along. The only
> thing worse than not asking permission is acting like that desktop shortcut
> is the most important thing in the world. (And believe me, there are
> installers out there like that.)

Yes that is good advice. I decided to try Inno setup, I now have a
script that does the installation and includes checkboxes to optionally
let the user install desktop or shortcut icons.


Sun, 24 Feb 2013 04:11:55 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7
<snip>

Quote:
> Yes that is good advice. I decided to try Inno setup, I now have a
> script that does the installation and includes checkboxes to optionally
> let the user install desktop or shortcut icons.

Sorry, that should read optionally let the user install desktop or quick
launch icons. Innosetup is really impressive.


Sun, 24 Feb 2013 04:31:10 GMT  
 create desktop shortcut when app installed w/P&D installer for XP,Vista,W7


: Sorry, that should read optionally let the user install desktop or quick
: launch icons. Innosetup is really impressive.

And the price is certainly a bonus.  Not to mention if one understands
Delphi, the source can be reviewed.



Sun, 24 Feb 2013 05:26:49 GMT  
 
 [ 19 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Package & Deployment Wizard - creating a desktop shortcut

2. Creating Start Menu Program Items & Desktop Shortcuts

3. Creating Start Menu Program Items & Desktop Shortcuts

4. Creating app. icon on Desktop when installing

5. ini in app.pth works for xp, best practice for Vista/W7?

6. XP/Vista Visual Styles & Focus Rectangle

7. How/where to install VB6 app in Vista?

8. Installing a VB6 (SP6) app (not VB itself) under Vista

9. Installing a desktop shortcut along with your program

10. Install shortcut desktop icon ??

11. Installing shortcut on a desktop

12. Installing a shortcut on Client Desktop

 

 
Powered by phpBB® Forum Software