visual studio setup project shortcut not working [duplicate] - c#

I have a very simple Windows Forms application (not the one with the .NET Framework) and I want to make an installer for it. The problem is that whenever I'm trying to run the installed application, it displays an error saying that it requires .NET Core to run, even if it's already installed. I tried including everything from the project output folder, including .exe and .dll files, but that doesn't seem to work. Here's how installer project files look like.

Please check out my nanny-level teaching!
Environment:
1.Add Enxtention:
2.Install Microsoft Visual Studio Installer Project:
3.Closs the ide to start installing:
4.Create a setup project:
5.Modify the information as needed:
6.Right click Setup (Application Folder) > add > file > (all the file):
7.Then create a shortcut, cut it to User Desktop and, after creating a shortcut, put it in User Program:
8.Build:
8.Install and run:

Related

Building a Windows Setup Project gives many Setup files

I did the following steps to create a Windows Setup project:
Create a Windows Forms Application using Visual Studio
Install "Microsoft Visual Studio Installer Projects plugin"
Add a "Setup Project" to the solution
In the "Application Folder", add project output
(Steps 5 and 6 are optional)
By right clicking the Setup project and opening "Properties", select "Prerequisites"
Select "Download prerequisites from the same location as my application"
Build the solution.
After all these steps, I see many files (Setup.exe, Setup.msi, NETFX472 folder) in the Release folder. But I only want one simple self-contained setup file. So, users can run the setup file and install the application easily.
How can I make a simple and self-contained Setup file for my project?
I know it's possible, but I am looking for an easier and more efficient way to do it.
I know I can create another Windows Forms app called Setup which copies the project outputs to user's Program Files directory and copy the output files one-by-one. But I don't think that solution is elegant.
EDIT:
After more tries, I learned that Setup.exe is for installing dependencies (only .NET Framework 4.7.2 for my case) and then running Setup.msi. So, without Setup.msi file, Setup.exe is nothing and vice-versa.
Also, I want my program should work 100% offline (including setup). So, installer should include offline .NET Framework 4.7.2 installer.
What I don't want here is Setup.exe to only install dependencies. It should also install my program. So, it should do also whatever Setup.msi file does. Second thing I don't want is dependency installer as separate file (offline .NET Framework 4.7.2 installer in this case). It should also be embedded into Setup.exe.

My Visual Studio 2019 WPF app is setting a dll as the output when it should be an exe

This is my first time trying to make a deployable program. After creating a nice little WPF XAML app that runs (i.e. I can run the executable in the bin folder), I am trying to wrap it in a setup program.
After following multiple directions online for both WiX and "Microsoft Visual Studio Installer Projects". Both make installer packages, but they are only targeting the dll file from the WPF XAML output when I as for the "Primary Output". It seems this is stemming from the build of the WPF project.
How do I adjust the primary output of the build process so it is included in the setup program?
Screenshot of build output specifying the dll as the output file:
To add more details:
This could be one wpf(.net core) application instead of one wpf(.net framework). See the Output window in Elton's screenshot we can find the output is xx.dll instead of xx.exe.
If we create a Installer project in this solution, right-click the Installer project=>Add=>Project Output=>Primary output to contain the WPF's output in installer project, only the xx.dll is considered as wpf's output, but not xx.exe.
So after building the Installer project in VS, double-click the setup.exe(installer project's output), the wpf.exe is not well installed.
On top of Lance answer. You can add the publish items to your outputs near your main Primary Output.
1- Right-click on project and select Add => Project Output.
2- Choose your target project and select Publish Items from the list with your configuration.
3- Now you have another Output in your Application Folder.
Done. with every Batch Build you have your publish directory copied to application folder.
My Visual Studio 2019 WPF app is setting a dll as the output when it
should be an exe.
I'm sure you're using a WPF(.net core) project cause yesterday I happened to reproduce same situation in my machine. As for the cause of the issue, if you're interested in it, you may get some help from this issue. For .net core 2.2 and earlier, if we build a console(.net core) project, we'll get a xx.dll as output by default(Use dotnet xx.dll to run that).
But for .net core 3.0, I found this situation changes. Now if we build a Console(.net core) or WPF(.net core), apart from the xx.dll, we'll also get an xx.exe now. And I checked the Updated date of Installer Project and the Release date of WPF(.net core), the latest update of the Installer project is much earlier than the release of WPF(.net core), I guess maybe this is the cause? I'm not certainly sure how Installer Project recognize the output of one WPF project, but I suggest you can post this issue in DC forum , if it gets enough votes, the team will consider a fix.
Here're my workarounds which may help:
1.Use Add=>File instead of Add=>Primary Output:
Build the WPF project in release mode, navigate to the output path and copy that path. Then right-click Installer project=>Add=>Files to enter that path. Choose all files in output folder and click open:
Right-click the assembly file and choose Find in Editor:
Right-click the xx.exe=>Create a shortcut. Then move the shortcut to User's Desktop folder and set the AlwaysCreate property to be true.
After that, build the installer project and install that xx.msi or setup.exe in my machine, I'll get a shortcut in desktop, double-click it will run the wpf(core) application.
2.See this blog, we can use command like dotnet publish -r xxx -p:PublishSingleFile=true to get a single-file executable which is self-extracting and contains all dependencies (including native) that are required to run your app. In this situation, you don't need a Installer project to deploy your project. The single executable is enough. Hint from Lex Li in this issue.
Hope it helps :-)

Why Installshield LE Visual Studio 2010 Primary Output puts generated files on desktop

I have a solution in Visual Studio 2010, with seven projects. I have added a Installshield LE Setup project and when I add my main projects Primary-Output and then add a shortcut for the Primary-Output on the desktop, in the Installshield assistant.
Now when I install my application it creates a shortcut on the desktop, as expected. But when I run my application; it has a built-in logging class that generates a few log files. Now when I click the shortcut on the desktop to run the application, it creates my log files on the desktop, as well as where they are supposed to be created, which is the applications directory.
Why does installshield do this, because it's my understanding that it should only link to the .exe in the applications install folder, not think that it's launching the application from it's install folder.
I have gotten this to work by manually adding my output files to the setup project, but this is not ideal, as I would love to be able to configure this and then when I need to build a new installer, just build project and it's done.
If anybody can recommend a better installer that fits my needs, that would be great.
Installer Requirements
shortcut on desktop for application
shortcut on desktop for a url shortcut
shortcut in startup folder for application
eula
Something that is simple to get a setup project created, as I have a deadline and was only given 1 day to build and package a release build for a client.
Sounds like your app is creating log files wherever it's launched from, which isn't really Installshield's fault. You should really be writing to somewhere like the LocalApplicationData folder: http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

Deploy Windows Applications with Visual Studio.NET

I have created a window setup file for my window project in visual studio 2008. This setup file is running properly and installed the software in computer. But I want to add a external exe file into my setup project. But this external exe should not be installed on computer. How can I add this another exe file in my setup not for installing?
Well that is relatively easy, follow these steps and you will be on:
Add new setup project (if you already have one, disregard this step)
Click on the setup project, then on the left panel select the application folder.
right click the application folder --> Add --> File.
Select the file you want to install with your setup.
you can choose in the application folder properties whether to always create this folder and its files or not.
That it :)

.NET .application installer files?

I've seen popping up around the web recently .application files, for .NET installations. (Application manifests, per the extension details).
How exactly does one create these .application files in Visual Studio, and how do they differ from a standard windows setup? Please enlighten me.
I'm a C# developer, but never used a .application installer before.
How exactly does one create these .application files in Visual Studio?
.application file is automatically created when you do a click-once deployment.
For click-once deployment, you can
Right click on the project you want to release and choose publish menu item.
-- or --
Right click on the project, select properties, go to publish tab to publish.
how do they differ from a standard windows setup?
You would create a standard windows setup program by creating a setup project in your solution. And also they differ in a way that, for click-once, end-user does not have to install the program on their local machine.
You can learn more about differences between them from MSDN
Choosing Between ClickOnce and Windows Installer

Categories