.NETGURU
VS.NET always adds desktop application
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.setup.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Jeff Moulton via .Net Guru (VIP)
I have developed a Windows Desktop application in VS.NET 2003 and created a Setup project for it. In the File System Editor I have added a shortcut to the User's Desktop folder to point to the application once it has been installed. I have added a condition to the User's Desktop named "DESKTOPSHORTCUT" (I have used several names, this is just the latest). In the User interface, I have added a screen with a checkbox that asks the user if he/she wants to add a shortcut to the desktop. The Property of the checkbox is "DESKTOPSHORTCUT" and the checkbox is unchecked by default (I have also tried it as checked by default).

When I run the installation, it asks if I want to add a shortcut to the desktop and then it adds the shortcut regardless of whether the checkbox is checked or not. This same behavior is repeated on other machines.

I have tried many combinations and combed through several web sites about creating Setup projects in VS.NET but have been unable to find a solution. Has anyone encountered this before? How can I fix this?

--------------------------------
From: Jeff Moulton

-----------------------
Posted by a user from .Net Guru (http://www.dot-net-guru.com/)

<Id>j5Kz1pR9lEmq1rkwL76HLw==</Id>
Reply to this message...
 
    
Phil Wilson
You can't really do this within the constraints of a VS setup project, at
least not that way, because the installation of the shortcut is tightly
bound to installation of the file. What you can do is use a custom action,
VBScript will do, conditioned on that property. This is copied from the
documentation, not exactly what you want, but the SpecialFolders and
CreateShortcut keywords should get you started.

set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut
Script.lnk")
oShellLink.TargetPath = path to exe
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "notepad.exe, 0"
oShellLink.Description = "Shortcut Script"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Microsoft Web
Site.url")
oUrlLink.TargetPath = "http://www.microsoft.com";
oUrlLink.Save

--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/002-8326859-8978461

"Jeff Moulton via .Net Guru" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
I have developed a Windows Desktop application in VS.NET 2003 and created a
Setup project for it. In the File System Editor I have added a shortcut to
the User's Desktop folder to point to the application once it has been
installed. I have added a condition to the User's Desktop named
"DESKTOPSHORTCUT" (I have used several names, this is just the latest). In
the User interface, I have added a screen with a checkbox that asks the user
if he/she wants to add a shortcut to the desktop. The Property of the
checkbox is "DESKTOPSHORTCUT" and the checkbox is unchecked by default (I
have also tried it as checked by default).

When I run the installation, it asks if I want to add a shortcut to the
desktop and then it adds the shortcut regardless of whether the checkbox is
checked or not. This same behavior is repeated on other machines.

I have tried many combinations and combed through several web sites about
creating Setup projects in VS.NET but have been unable to find a solution.
Has anyone encountered this before? How can I fix this?

--------------------------------
From: Jeff Moulton

-----------------------
Posted by a user from .Net Guru (http://www.dot-net-guru.com/)

<Id>j5Kz1pR9lEmq1rkwL76HLw==</Id>

Reply to this message...
 
    
Flyfish
How using the scripts is seen by MS? I thought they abandoned this... And
what about the antivirus software blocking scripts?

"Phil Wilson" <Click here to reveal e-mail address> wrote in message
news:%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Phil Wilson
Scripts generally need blocking in web pages and HTML email (as examples)
but if you're going to run an MSI file, you basically need to trust it just
like you would trust any program that you run. If you think about it, it's
dangerous that some setups require administrator privilege. Occasionally
antivirus programs block VBScript in MSI files because they disable all
scripts and don't differentiate too well, but I believe it's rare.

This is a VBScript embedded in an MSI file we're talking about, and the MSI
file could have executables, system DLL calls and all kinds of code being
run. If you're running an MSI file, the fact that it might contain VBScript
is probably the least of your worries! If you want to do it another way, you
can use the Win32 API calls from a C++ custom action DLL or an Installer
class call. VBScript is just the simplest way to code it and illustrate the
general idea.

--
Phil Wilson
[MVP Windows Installer]
"Flyfish" <Click here to reveal e-mail address> wrote in message
news:%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Security.Policy.Site




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification