 |
|
 |
I think most people would want to support shortcuts as part of an MSI installer project. This is just an ordinary Windows forms project. Even though the article refers to a setup project, the sample source code does not include a setup project. The form is mocked up to look like a wizard but it is not, in fact, a wizard (it supports only one "page".)
|
|
|
|
 |
|
 |
After installing a product, a shourtcut will be added under sendto in all the users(if install for everyone is selected). Please tell me if there is a solution
Thanks in advance
|
|
|
|
 |
|
 |
Hi,
this article was so helpfull.but i have one query .how to ask user for product key and validate that.is there any way to do this....?
Regards,
Rajkumar
|
|
|
|
 |
|
 |
There is another CodeProject article on this topic that shows an alternative approach: Conditional Install of Desktop and Quick Launch Shortcuts[^]. The alternative approach in the other article has two advantages over the approach shown in this atricle:
1. It will also remove the shortcuts when the application is unintstalled. An installer should remove the shortcuts created by the installer when the application is uninstalled, rather than leaving invalid shortcuts on the Desktop or Quick Launch bar. The approach in this article will not do this.
2. If the user has selected to install for "Everyone" and not "Just me", then the Desktop and Start Menu shortcuts should be installed for all users and not just the current user (note that there is no way to create a Quick Launch shortcut for all users). This article only allows shortcuts for the current user. The alternative article shows how to create shortcuts for all users, as well as the current user, based on what type of install is selected.
|
|
|
|
 |
|
 |
Hi there,
i love ur work and no doubt it is fantastic work but plz let me know if Uninstaller will be able to delete all shortcuts created by installer automatically.
And also do u know something about writing Upgrade patches in .NET so that once Installer Dispatched to a user can be upgraded periodically. Any Idea?
Thankyou,
Manmohan Singh Sarwara
|
|
|
|
 |
|
|
 |
|
 |
Thanks for the article.
My question is, can this be set to force the shortcuts to install regardless of whether the user chooses Themselves or All Users at the installation path dialog?
Or perhaps, offer then a choice on that same dialog to install shortcuts for all users or the currently logged in user..
Thanks
|
|
|
|
 |
|
 |
Hi,
This is nice question. But unfortunately I have not tried this. I will try this but meanwhile if you get any solution you can tell me. Thanks.
|
|
|
|
 |
|
|
 |
|
 |
How could I generate the *.lnk for the Help.chm, Read Me.txt and My Application.exe and get them in the Shortcut.cs, like in your example.
After that it would be very simple to design a more complete form to accept these little releases...
Tx
|
|
|
|
 |
|
 |
Do you want to create the shortcuts through code. Then this article will be helpful "http://www.codeproject.com/dotnet/shortcut_installer.asp"
|
|
|
|
 |
|
 |
You dont Realy answer to my question.
When looking at Shortcut\Form1.cs code I see the code:
if(File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Desktop).Trim()+"\\Shortcut to Test.lnk")==false)
{
File.Move(Application.StartupPath+"\\Shortcut to Test.lnk",Environment.GetFolderPath(Environment.SpecialFolder.Desktop).Trim()+"\\Shortcut to Test.lnk");
}
1 - I imagine that "Shortcut to Test.lnk" must be in the Shortcut folder ??? or anywhere else ? in this case, where ?
Application.StartupPath refers to the Folder where Shortcut is installed ? Am I right ?
2 - How can I copy the Shortcut created In the File System (SetupSample) into the Shortcut Folder ?
2 - I imagine too, that you renamed the Shortcut "Primary output from sample(Active)" on "Shortcut to Test.lnk", Am I right ?
My Question is : If I have a look into the Shortcut folder, I saw the shortcuts (for example "Shortcut to Test.lnk"). But How could I replace Them by the Shortcuts created in the File System (SetupSample) and Be shure they will have the good path to launch my application, the Help of my application and the reading of the Read Me file ?
Thank you if you could give me a detailed answer.
|
|
|
|
 |
|
 |
Hi,
Here are answers to your question: Let's start with simple ones
1) Yes, I have renamed the Shortcut "Primary output from sample(Active)" on "Shortcut to Test.lnk"
2) I have not created any folder to copy shortcut. They are left as it is in FileSystemEditor. I just move them to Desktop and Programs Menu and again back to StartUpPath in Release Version.
3) Suppose you have application HelloWorld.exe. This application will be installed in your "Program Files" directory by default within the directory probably named "HelloWorld" . In this folder "HelloWorld", there will be *.lnk files. And this itself will be you Application.StartUpPath. I don't have one more Shortcut folder within "HelloWorld" folder.
Hope this answers your question
|
|
|
|
 |
|
 |
I give you more informations about my needs...
when deploying my application, I let the user install the application Anywhere He like to...
If I create 3 Shortcuts (My App, Help, Read Me) on the Shortcut Folder and use your Shortcut.exe, called by the Setup as you give the example.
Shortcut will install the Shortcuts on the Desktop, the Start Menu, the Quick Launch, it's ok, it works !
but ! How could I be sure that the Shortcuts really links to the destination the user choosed to install my application if the Path is written in the Shortcut at Design time ?
I need to write the Path in the Shortcut. How ? and where could I find the Path at Deployment time ?
Looking forward to reading you...
|
|
|
|
 |
|
 |
Though you create shortcut at design time, in code you refer to the Application.StartUpPath. So during installation, wherever you install the file that path becomes application startup path. You need not worry about linking part. System will take care of linking. I just tried this, and it works irrespective of where you install it.
|
|
|
|
 |
|
 |
Oh God !
Thanks for your Help !
Tell me if I'm right now !
If I have understood, it works because the Shortcut.exe is Installed In the application Folder by the Setup.
So the Application.StartupPath is the same for the Setup, the Shortcup.exe and so on (My Help and My ReadMe file, if I decide to install them in the same folder) ???
If I'm right, it's a quite simple, but good solution.
|
|
|
|
 |
|
 |
I made a test.
On My Desktop I create a shortcut to a file logged on the desktop.
After that I Cut and copy the file in another folder.
If I read the properties of the Desktop, they are not updated by the move operation.
the link still remain to "C:\Documents and Settings\Admin\Desktop" Not in the other Folder
So I don't understand what you mean, when writing :
You need not worry about linking part. System will take care of linking. I just tried this, and it works irrespective of where you install it
|
|
|
|
 |
|
 |
Hi,
Don't change the location of original application. Just cut or copy the shortcut somewhere else. It Works.
|
|
|
|
 |
|
 |
Yes, you are correct. But Application.StartUpPath has no direct significance with respect to Shortcut files. It could be any other valid path. Just to know the source of these *.lnk files at runtime or during installation we have placed them in Application Folder and used Application.StartUpPath. So if you install your application in one folder and *.lnk files in some other folder and change the path in code, still it will work.
|
|
|
|
 |
|
 |
Thanks a lot
It works !
I discover a new Intersting use of the Shortcup.exe.
As it is installed on the PC.
The user could use it, as many time he like to, to change his environment...;)
|
|
|
|
 |
|
 |
I don't find How to create de "My Application.lnk" which is used in Form1.cs.
Because I need to install Shortcuts to :
Read Me,
Help,
and My Application.
For the two first it's quite easy, I right click on the Help.chm and on the Read Me.txt and answer to get a shortcut.
But for my Application I don't find the MyApplication.exe file in the System Folder of MySetup.
Could you help me please...
|
|
|
|
 |
|
 |
For creating shortcuts to .exe, you have the same procedure. Just right click and select "Create shortcut". Have I helped you? If you have any doubts on this please ask.
|
|
|
|
 |
|
 |
Very useful, i have spent a great deal of time looking for something like this. Thanx
|
|
|
|
 |