How to publish console app into executable - visual-studio

When I publish my console app I get three files:
Application Files (Folder)
ClickOnce Application
setup
There has to be a way that gives me just a .exe that has everything the app needs to run within in.
I'm using Visual Studio 2010, and don't see any obvious options that would allow me to do this.
Note: Using the setup file appears to just make a shortcut to the ClickOnce Application that I already have.

Look in the bin directory of the application, it should have published an executable for you.

Related

How to turn visual studio files into actual app that can be sent/ downloaded and run by another user?

I have a finished project with a bunch of different winform files. They are linked between eachother through a menu file. How do I go from having this project as a visual studio application file to an actual application, with customized icon and that can be opened by a user from another PC (which doesn't have Visual studio). I don't want to just zip them.
I didn't try anything and this might be a newbie question but what I expect is basically to have an actual app instead of a bunch of files.
When you compile the winforms project you get a bin folder and a Debug/Release folders inside.
A simple way to deliver the app is just copy the Debug folder that have the .exe and dll files to the dest PC.
The best way is to follow this guide:
https://learn.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-using-clickonce-folder?view=vs-2022
Or make an autoinstaller

VS2019-Generated Published App Package contains file locations on my computer

I am new to Xamarin and am trying to publish my application as a side loading package. I use VS2019 to publish the UWP application. The problem I have is that the AppInstaller file that Publish generates contains explicit references to folders on my computer. This, of course, works on my computer, but does not on anyone elses' computer. Here is an example from the AppInstaller file:
Uri="file:///c:/SpectrumApp/SpectrumApp.UWP.appinstaller"
I can write a powershell script to modify the App Installer file to contain the correct file path for a given system, but that seems like a workaround to some basic thing that I am doing wrong with the Publish capability built into VS2019.

How do I compile a UWP application to a stand-alone EXE file?

I have a UWP application. I can run it inside of Visual Studio by using the Run button. I also know how to create an App Package and distributed it via App Center.
What I can't figure out how to do is build an EXE file that I can run on my own computer without launching Visual Studio (or copy to another computer). I found the EXE in the project folder under bin/x64/Debug (or bin/x64/Release), but it won't run. In fact it does nothing when I double-click on it.
What am I doing wrong?
The easiest way I have found to get apps installed on computers for non-technical users is to give them the output of that Create App Packages submenu, which includes a ps1 script and certificate file. If you give it to them as a zip make sure they unzip the whole folder first, and run the ps1 script from the unzipped folder. If Developer Mode is not enabled on their computer, the settings dialog to enable it will open automatically, and they just have to flip the switch. Otherwise, they are just pressing Y or A in the PowerShell window to continue through the installation process.
It's not too bad, the whole thing takes about 30 seconds if you breeze through it, but I believe you need admin rights on the computer you're installing on, there's a UAC prompt at some point.
I found the EXE in the project folder under bin/x64/Debug (or bin/x64/Release)
The exe file is the uwp executive core, but it could not run directly, because it has some dependencies need to be packed together, so we need use Visual Studio to create package for your app. And this document contains detailed steps you could refer.
After getting the installation package, we need the side-load, and please note:
If you are not publishing your app and simply want to sideload an app package, you first need to trust the package. To trust the package, the certificate must be installed on the user's device.

UWP publish output always in test folder

Why is it that even though I have the build setting in Visual Studio set to Release everything I create within a side-loaded UWP distribution is placed within a folder with _test on the end? Is it because MS assumes a side-loaded app is always a test app?
I place my appxbundle files within AppCenter and I'm using AppCenter to distrubute our internal production apps to our internal employess using AppCenter.
Here is the main reason I'm even asking. I have tried to publish an appxbundle to the AppCenter for my employees to download and install. Problem is, these target laptops don't have the Microsoft Store installed (don't ask) so the appxbundle won't auto-install. So, when I try to install via a powershell script I can clearly see that the dependency for Microsoft.NET.Native.Runtime.2.0 isn't being met and the install fails. When I extract the appxbundle for my app I see no dependencies are included. But, if I explore the root folder that my app is published to, I can find the Microsoft.NET.Native.Runtime.2.0 is there, it's just not making it into the appxbundle file. In order to install this app on these laptops I have to enable developer mode, I have to zip up the entire published folder, send this zip file to the user, have them extract it, then have them run the powershell script within the root folder. This powershell script installs my appxbundle, cert, and includes all dependencies.
I read HERE the following:
App Center always generates an app bundle. However, Debug builds are
not meant to be used for sideloading. ...and the provided .appxbundle
files in the Test folder do not contain required dependencies.
Since my dependencies are not included within the appxbundle and based on what Microsoft said, it appears my app is being generated as a Debug build even though I'm selecting Release within my IDE before publishing.
Sadly it's hard-coded in the msbuild file "Microsoft.AppxPackage.Targets"
Location for VS2019 C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppxPackage.Targets
Or as MSFT UWP Engineer Nico Zhu said in the comments: "it is by design"
See also: Customizing Visual Studio MSIX packaging project output

Can a ClickOnce project be configured so that downloaded file is called differently from setup.exe?

I'd like to make it so that when users click the "Install" button, the installer file they download to their local machine is called differently from default setup.exe, e.g. myCoolInstaller.exe. Is that even possible with ClickOnce?
A simple option is to use symbolic links. From the command prompt, whilst in your release folder type:
mklink myCoolInstaller.exe setup.exe
Then everytime you publish to setup.exe, your users can download using the more friendly name. Note that this does not update the publish.htm file - you will need to edit that yourself. In our case, we don't use it - we provide a link to our customers directly to the installer .exe
The setup.exe file that is generated by Visual Studio has very little to do with ClickOnce. It simply bootstraps your pre-requisite installs together and launches your actual ClickOnce app (the .application file) when it's finished.
You should just be able to rename it.

Resources