Visual Studio Setup Project - Create shortcut of exe file - c#

I have made a simple project that allow to Drap & Drop CSV file on to its EXE file to automatically read the data and export to Excel file.
When I test the program by Drap & Drop CSV file to the EXE file in bin/Debug and Release folder, or to the shortcut of the EXE file I place on Desktop, everything is fine.
When I make a Deployment project for the above project, and follow all the steps to make shortcut of the program, I cannot do the Drap & Drop on the shortcut after install the program.
The reason seem to be that the target of the shortcut is not the EXE file, but (as indicate in the Properties View in VS) [Primary output].
I have tried to manually create a shortcut of the EXE file in the installation folder, and it worked fine.
Could anyone help me on this problem?

If u creating window setup project ... then it displayed icon is Advertisement not a Shortcut link..
and you create a shortcut of your Exe then ...its a creating a shortcut link ...
These shortcuts are called Advertised shortcuts. They will give the application abilities of installation-on-demand and advertisement. When a user click on such a shortcut, Windows Installer will check the integrity of the application and automatically install/repair missing or corrupted components.
To disable the advertised shortcuts, you must set a property called DISABLEADVTSHORTCUTS to value 1 in the MSI package.
http://msdn.microsoft.com/en-us/library/aa368297(VS.85).aspx

Related

Visual studio deployment project shortcut for primary output - 'Open file location' not working

When you create a shortcut to the primary output with your deployment project, following these steps:
(as per this post Visual Studio Deployment Project - Create shortcut to deployed executable)
In your Deployment Project go to File System Editor Click on
"Application Folder" (I assume you have "Primary Output" from your
projects there) Right click on "Primary Output" of the project you
want to target with your shortcut - select "Create Shortcut to Primary
Output ..." Rename shortcut Drag shortcut to Desktop /
Programs Menu folder
It all works fine, BUT when you right click on the shortcut on a target machine after installation and select 'Open file location' option, which should open the folder of the actual exe, Windows open the folder where the shortcut is located. The 'Open target location' button in 'Properties' of the shortcut is disabled.
Any idea why is it not linked properly, even though clicking on it launches the executable all OK?
Shortcuts installed by MSI are by default advertised shortcuts. It just means that the shortcut is an indirect pointer to its target, containing Windows Installer ProductCode, Feature name and Component guid. As part of the activation it checks that the target file is present, and if it's not it will cause a repair of the installed product.
If you set DISABLEADVTSHORTCUTS to 1 on the command line install or manually add it to the Property table of the MSI file (InstEd or Orca) this will disable creating them.
https://msdn.microsoft.com/en-us/library/aa368297(v=vs.85).aspx

how to create exe file from my class and file on runtime [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to make exe file with c#
i have one program in c#. this program get parameters(file for example *.jpg) from user and finally after click user on build button my program create one other program in windows application (cs:Form) that is has one viewer for images and store app in one exe file. i need help for how to create exe file from form class.
I just answered this for you on your closed question.
This is a great tutorial on building an EXE from your code using VS2010 express
If you end up working through the tutorial and then get stuck, then post here and we can help you. Right now we don't know with what or where you are stuck.
Per Gabe's request, from another source. http://www.ehow.com/how_6352221_create-studio-2008-express-edition.html
Instructions
1
Open your application in Visual Studio 2008 Express Edition.
2
Click Build. You have two choices now: You can choose to simply build an EXE file and its libraries or you can choose to publish a setup application that will install the program on a client's computer. This will automatically build "Start" menu shortcuts and an uninstallation program for your application.
If you just want to build an EXE file, go to step three. If you want to publish a setup program, go to step four.
3
Click "build (your project name)."
If there are no errors in your project, then the status bar at the bottom of the window will soon read "Build succeeded."
Navigate to the location of your project using Windows Explorer. By default, it will be in the folder "My Documents" under Windows XP.
To get there, click "Start," "My Documents," "Visual Studio 2008," "Projects," and then the folder with the name of your project. Again, there will be another folder with the same name as your project.
Go into the "bin" directory. There will be either a "Debug" folder or a "Release" folder here (or both.) Choose "Release" if you have it.
Your .EXE file will be in that folder.
4
Click "Publish (your project name)."
Click "Browse" and select the location where you wish to publish your application. For the moment, a folder on the desktop would be a good choice.
In the next window, you'll be asked how the users will install the application. Choose "from an executable file."
Next, you'll be asked how the application should check for updates to itself. For the moment, choose "This application will not check for updates."
Click "Finish."
Three files will be placed in the folder on your Desktop: the setup application, an autorun.ini file to allow your setup program to be autorun from a CD and a manifest file that is needed by the setup application.
Read more: How to Create EXE Program Files in Visual Studio 2008 Express Edition | eHow.com http://www.ehow.com/how_6352221_create-studio-2008-express-edition.html#ixzz2IjDfQpUQ

Link to config file in .Net setup project

I am creating an installer for my C# application, and I want to put a link to the configuration file into the start menu, so that users can open it for editing in notepad from the program folder in the start menu.
I seem not to be able to put a link to it however - does anyone know how to do this? (Really, I would just love to put "[targetdir]\myapp.exe.config but VS doesn't let me edit the field, only select from a file browser).
Many thanks,
Rob
I found the solution and it's pretty easy:
Add Project Output for your project in the setup project
Select Project Output from File System in left pane and go to the properties of the project output. Then add a filter *.config to remove the .config file from your project output.
Rename the app.config from your actual project to the output name that your App exe ([ProductName]) will have along with the config extension ofcourse.
Add the [ProductName].config to your setup project as a File.
Create a Shortcut to that file and add it in any setup folder desktop or program folder.
Voila.
You're all set.
Isn't the config file added in your installer? You should be able to select it when prompted for the shortcut target (the "Select Item in Project" dialog). Please note that in this prompt dialog you first need to browse to the folder which contains it (for example double-click "Application Folder").
If the config file is not added, you need to manually add it in "Application Folder". Only then you can create a shortcut to it.
Please note that Visual Studio doesn't support shortcuts to a specific file from a project output which generates multiple files. In this case you can try using a custom action which creates the shortcut through custom code.
I remember doing it in Vs2005 using as below:
File System Editor > Users Programs Menu
Add> Folder
Add file (Say Config file) point it to the its location

Problem with windows setup project (c#, winforms)

I've created a windows application in c# now i added a new setup project to this application and i build it. It is executing successfully. When i try to add project output to user desktop. There are two files adding in the desktop one is exe file and another one is xml file (configuration file). Why it is happening. How can i add only exe file to my desktop while running the setup file.
Thank you,
Nagu
You have to add a shortcut to project output, not the project output itself. You can do this by selecting the "User's desktop" folder, right click and select "Create new shortcut" and in the select item dialog go to "Application folder" and select "Primary output from your project".
Is there a reason you're are trying to put the exe on the desktop? Standard practice is to place it in a folder in Program Files (or somewhere the user designates) and place a shortcut on the desktop.
Assuming that you already have the exe file added to your setup:
Right click your setup project,
click view->file system;
Right Click on User's
Desktop->Create Shortcut to user's
desktop
I think that would be it.

a Problem with Windows Help Button (EDIT-New problem)

a strange behavior happens when install the application and then run the exe file.
first let me explain my steps:
1) i added HelpProvidor and i set HelpNameSpace property to the chm file path.
2) in the form properties i set HelpNavigator on helpProvidor property to : KeywordIndex
and HelpString on HelpProvidor to Use ASGATech Quran Sound Downloder Help
3) i created an installation pkg. and it runs successfuly.
My problem is when i debug the application and presses on "?" (which is the help button) it displays the chm file.
but when i run the sortcut on the desktop which has been created from the installation package it doesn't.
why is that the HelpNamespce is the same. and the exe which is in the Application folder is that same so why is that.
the exe file is the same and also when i created a new item in start -> program menu the exe file that created runs the chm file but the shortcut doesn't.
i put the chm with the application folder which throws the application folder on:
c:\program Files\Manufacturer\ProductName
and it put the file on this path successfuly so why he can't see it.
EDIT:
i found that the problem is when i uninstall the application it keeps the product folder
it only removes the icon ans chm and so when u reinstall the application he dont feel the new state (that he has chm file)
now how could i remove the product file from programFiles.
Are you sure the exe file is the same?
It seems that either the help file is not found by your application or that the current security settings of IE prevent it from being loaded.
Use a tool like Procmon to see where your application is looking for the help file.
If it is not found make sure that it is included within your installer package.
If it is found make sure that it is on the local disc and that the default security settings for your local machine have not been changed within IE.

Categories