Problem:
I have a visual studio solution with a visual studio setup project.
During the installation of the msi package, I want a shortcut to be created in the startup folder, so that my application can automatically start when the user logs in.
Action Taken:
I followed this :
How to create an installer project in VS2019 for a Windows form application
and this
Visual Studio Deployment Project - Create shortcut to deployed executable
This question must not be considered as duplicate as these steps are not working for me, they endup with a corrupted shortcut. The shortcut gets created but is not working:
The application deploys correctly and the link gets created but it does not point to the executable.
If you look at the picture below, you'll see That Target is greyed out and "points" to a folder. It should mention the executable name.
If I create a shortcut manually, you can see the difference (Target is properly filled)
Steps to reproduce:
Right click setup then view File System
Right click File System on Target Machine, then Add Special Folder / User's Startup folder
On the right panel of Application Folder, I right click Primary Output of FormAgent and Create Shortcut to Primary Output
I drag and drop the shortcut to User's Startup Folder and rename it appropriately.
Result: Shortcut gets created in the startup folder but is corrupted.
Troubleshooting done:
I wanted to create a shortcut to FormAgent.exe instead of a shortcut to Primary Output. But nowhere in the GUI I found a place to select anything else than Primary Output. Every single GUI is proposing Primary output from ProjectName and nothing else.
See the below picture which is the Properties of the shortcut: In the properties, if I click on Target, it points to Primary Output with no possibility to select an executable. (Add File is adding an external file to the setup project).
As additional troubleshooting, I went back to Application Folder and edited the properties of Primary Output, then clicked on Output:
The output displays 2 files and I wonder if this could be the cause of my problem. ( What is a result of a shortcut to an output that has 2 files?)
Related
How can I change DefaultLocation value of the Application Folder (or Custom Folder) in code?
I can define DefaultLocatio as [MY_DEFAULT] on the File System in Visual Studio, add to CustomActionData /myDefault=[MY_DEFAULT] and pass MY_DEFAULT as parameter to the msi file.
In code I can read it as Context.Parameters["myDefault"]. This works.
But how can i change in code the value of the DefaultLocation where the application will be installed?
Right-click your Installer project, go to View->File System.
Now right-click on the 'Application Folder' and select 'Properties Window'. In the Properties Window you can edit the DefaultLocation field (see screenshot below).
By default, the DefaultLocation is [ProgramFilesFolder][Manufacturer]\[ProductName] but you can change it to anything you like - C:\MyApp\ or [ProgramFilesFolder]MyApp\ or whatever.
Good Luck.
I have a WPF project that I am ready to deploy using Visual Studio 2012 but I'm running into a missing folder issue.
If I Start the project in VS it runs fine and my test button works as expected.
When I Publish the project, the publish succeeds, running setup.exe installs successfully and program starts to main window fine.
Clicking the test button crashes the application.
Line that causes crash:
string[] reportFileNames = System.IO.Directory.GetFiles("Reports");
"Could not find a part of the path 'C:\Users\dirt\AppData\Local\Apps\2.0\GEDD6PQW.N72\8M9ONPGG.TVB\prof..tion_40c30d08e677b188_0001.0000_9a5540d4bfbe5aff\ Reports'."
Confirmed Exists:
C:\MyProject\bin\MyMode\Reports\
C:\MyProject\bin\MyMode\Reports\MyReport.rdlc
Confirmed Does Not Exist: C:\Users\dirt\AppData\Local\Apps\2.0\GEDD6PQW.N72\8M9ONPGG.TVB\prof..tion_40c30d08e677b188_0001.0000_9a5540d4bfbe5aff\Reports\
The Reports\MyReport.rdlc files have a Build Action of Resource and Copy to Output Directory of Copy always.
What am I missing?
Ok, was able to figure this one out rather quickly after typing that last sentence in the question...
In my case the Reports\MyReport.rdlc file had a build action of Resource and all I had to do was change it to Content (and make sure Copy always is set).
Solution:
Right click File in Solution Explorer -> Properties -> Build Action -> Content
Yes I did my homework first. And I'm still stuck. First let me express my irritation at Microsoft for deprecating the Installer project type. Shame on them.
Back to my issue, Here is the error:
Error 3 -3204: Cannot extract icon with index 0 from file <some_path>\obj\Debug\MyProject.Gui.exe.
Attempt #1: InstallShield: cannot extract icon with index 0 vb.net
-- The answer says to include an object of type icon in my exe and rebuild. To do this, I tried the following:
right clicked on my windows forms project, add new item, icon, save all
open the icon file in step 1, draw some text in it, save all
right click the project and select rebuild (no errors, looks good)
left click on 'Specify Application Data'->'Files', select the *.ico in the project (Note: I can see it clearly listed, and it appears in the dialog as index0)
left click on 'General Information'-> 'Display Icon' -> browse for the *.ico (located in project folder for MyProject.Gui.exe)
save all and rebuild all
...I still get the same error message.
How does one "Recompile your EXE to include an icon and the message will go away"?
I had the same issue. Your problem is because you need to embed the icon into your executable. The way you do this is in Project Properties window in Visual Studio (Alt-Enter or right click ->properties for project root in solution explorer).
In the project properties under Application, there's a group box called Resources. Add your icon as shown below and install shield will build fine.
Hope that helps.
I was getting this problem, I try a lot of solutions on the web, but the only way that works for me:
Expand the deploy solution (+) on the right panel (Solution Explorer)
Expand the menu "Configure the target system"
Double click on Shortcuts folder
Here you will find 2 output you set up in the project wizard.
Select one of them, and find the property Icon, click to (...) to browse the propertly icon.
Do the same with the second one output built solution.
Rebuild your project!
Regards,
You need to copy the icon file to the debug folder of your windows application to successfully compile.
Go to Shortcuts/Folders under configure the Target System.
Select your application from the tree.
Select the icon and change the index to 2 (or something other than 0)
Build it.
If the problem is that you associated the icon with the installer and you embedded it into your application but you are still getting this error, try adding a folder exception to your antivirus software. The exception should be the folder where your source is located and the executable is output.
The symptom is that you randomly get this error during a build. It is caused by your antivirus software preventing the installshield icon extractor from accessing your application executable.
This happened with me also. My application runs in the background so I didn't create an Icon for it. When this error occurred I assigned an icon and everything built okay.
How do I add my program to the users start menu with VS2010 Setup Project?
I don't see an obvious place to do this.
What would be even better than this is a link to a reference that holds my hand through setting up projects so I can see how it is supposed to be done.
Thanks!
Go to Application Folder, look on the right hand side it should say, Primary output from X (make sure you don't have other widgets covering up this real estate.)
Right click that => make shortcut
Go to User's Program's Menu ==> create the folder that you want your shortcut to reside in, probably your company name
Drag the shortcut from step 2 to the folder you just created.
You can add a short cut in to the executable in the File System view.
More steps here
In the Setup Project File System, right-click the User's Programs Menu, and create a folder for your application. Go to the Application Folder, right-click project output, then select Create Shortcut to xxx. Drag the shortcut to the application folder.
After wasting an hour, I got it done - VS 2010 (this article helped):
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
That's it!
Right click on the setup project and click View -> File System. There is a foler there for User's Programs Menu. You can add a shortcut to your project's executable there.
Here is a link that walks you through the process.
Creating the shortcut at the top level of the start menu is not really standard behavior. The shortcut should be created in the folder [Manufacturer][ProductName] in the user's "Programs" menu. However, it seems you can't use the installer properties in the Visual Studio deployment proje
Sorry I'm 11 years late for this but here is a way to do it:
Right click on "Application Folder", click on "Properties", then change "AlwaysCreate" to true.
right click on "Application Folder" and click "Create Shortcut to Application Folder"
Rename the "Shortcut to Application Folder" to whatever name you choose.
Drag that shortcut into the "User's Desktop" or "User's Programs menu".
Build the project.
You're done! :)
I have got source code from the site and want to run that small application.
What are the steps and what should I do to run that application?
I have shown the attachment pics showing the files of that application that are:
MRG.Controls.UI
MRG.WinForm.Test
MRG.Controls.sln
MRG.Controls.suo
now the folder MRG.Controls.UI have the following files,
Properties
LoadingCircle.cs
LoadingCircle.Designer.cs
LoadingCircleToolStripMenuItem.cs
MRG.Controls.UI.csproj
and the folder MRG.WinForm.Test have the following ones:
Properties
frmMain.cs
frmMain.Designer.cs
frmMain.resx
MRG.WinForm.Test.csproj
MRG.WinForm.Test.csproj.user
Program.cs
If visual studio is installed double click on MRG.Controls.sln file
then press F5 key or Debug->Start debugging from menu item in visual studio application
You need to double-click on the MRG.Controls.sln file which will then open it in Visual Studio. If you don't have the right version of VS.Net installed, you will need to install that, of course.
Once loaded, ensure that the top-level node in Solution Explorer is selected and then press F5.