Conditions and the File System Editor

APaule

Centurion
Joined
Mar 26, 2003
Messages
105
I wanted to make the installation of a desktop link dependent on a condition.
So I set the Condition property of the User's Desktop to the CheckBox1Property of my Checkboxes (A) dialog which I added to the Start section right before the Installation Folder dialog (I found an example where it was described that way).
BUT it does not work :( ! The condition is ignored. The link is installed anyway. I even set the Transitive property to true, because I made these changes after the first installation of the assembly.
Any idea or hint why it doesn't work, or even better, how it is done correctly, is appreciated!
 
Oh that's brilliant.
I proceeded one step and it seems to be the last one as well. There seems to be no solution to my problem (except using InstallShield or WISE Installer :D ).

First of all, the example I found must be wrong. In that example they set the Condition of the User's Desktop. But this obviously seems to be the Condition for installing the Desktop itself. So this Condition will never get to action, bacause the Desktop just exists (I hate examples no one tested before).

Then I found following article: How to add a shortcut file to a Setup project in Visual Studio .NET

Now that's a real bummer :( . It suggests that you should add a .lnk file to the project and treat it as Project Content. BUT then the .lnk file is copied to the Desktop as is; with the original link it was created with.
So with the Project Content you could set the Condition ... and it works fine now, BUT THIS FILE HAS NO IDEA WHERE THE APPLICATION IS INSTALLED. So actually it is a .lnk file, but it is not a shortcut to the application. :p You'd have to manipulate it after installation. Big deal.

Then the dilemma came clear to my mind. When you create a shortcut from the Primary Output of the Project (the easiest and only way as it seems) and add it to the User's desktop IT HAS NO CONDITION PROPERTY. The Project Content has.

So: Best regards to Micro$oft. They did a lousy job here and the above mentioned article is an offence for intelligence. It's hard to believe, but they just seem to have forgotten, that there might be a slight possibility, that any developer could eventually give the user a chance to decide during installation to create a shortcut on the desktop or not. :rolleyes:
 
Back
Top