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

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

Related

Deployed SFML Game not finding resources?

I am using SFML 2.0 and Visual Studio 2010 professional to create a game. When I test my game from within Visual Studio, it works perfectly fine, loads up all the resources. It has no problem finding all of the resources. However, when I build my setup.exe file and install my game, the deployed version cannot find the resources.
I feel like this has to do with where it is looking for the resources within Visual Studio compared to when it is installed on the system. Within Visual Studio, the program accesses a "res" folder that is in the default directory with the project file. Shown here.
When I install the game, I package the "res" folder to be installed next to the .exe like-so.
However, when I run the deployed game, it cannot find any of the resources, and thus, crashes. I feel like this is a real simple fix, just a matter of me placing the "res" folder in a different location, but I have been messing with it for a while and cannot get this to work. Where do I place the "res" folder in the installer?
Given you have not provided any code, I'll assume you're loading your resources with relative paths. This means that your application will be looking for the files relative to the working directory. Now the working directory can be changed and Visual Studio does so and sets it to where the project file is located in (by default). When you now run your application by double clicking on it, the working directory is where you application itself is located. As such your setup should work.
However if you have a conjunction or you start the application from within your setup, you need to make sure the working directory is set correctly.
Additionally you could also change the working directory within your application, but this will require some platform specific code (or the use of for example Boost's Filesystem).

Can I exclude/ignore files from Multi-Device Hybrid App build? (In order to prevent EBUSY error when building)

I'm getting this error when building my Multi-Device Hybrid App.
EXEC : error : EBUSY, resource busy or locked 'C:\path\to\project\bld\Debug\www\.svn\wc.db'
Suspected cause:
From what I can gather, when the Multi-Device Hybrid Apps Visual Studio extension builds the app it seems to grab all files in the project directory (except for some specific files/folders e.g. bld/bin directories and the .jsproj file) and add them to the package. That's ok, but not ideal, it really should only be grabbing the files in the VS project. The problem I'm experiencing is becuase it's grabbing my SVN .db file and adding it to the package, TortoiseSVN status cache then picks up this file and locks it - resulting in my error.
This is my specific issue, but I believe others could experience similar issues if they have any other files in the directory that they don't want included in the app bundle. I'd suggest it could be fixed by somehow setting excluded files/folders from the build or by the build script not grabbing everything, only those files included in the visual studio project. I'm not sure how to request that, so hopefully the developers will see this post...
So, my question is: Does anyone know of any way to tell the Multi-Device Hybrid Apps Visual Studio extension build process (or vs-mda\vs-cli) to ignore certain files or folders?
Or, does anyone have any suggestions as to how to make SVN and this VS extension play nice?
Unfortunately Visual Studio includes all the files under project directory except bin\bld folder. Currently only simple workaround would be to keep the files which you want to be excluded from package outside project directory. You can add the file to solution explorer by using Add --> Existing Item --> Add as link in case you want the file to appear in solution explorer but not included for build or packaging.
it seems folder with test as its name will be considered differently, and it will be excluded from package.

Create Visual Studio Solution from Batch File

Visual Studio seems to consist of a single solution file (*.sln) along with one or more project files (a C# project would have the *.csproj extension).
I have been playing around with a console application that parses existing directory entries to create solution files with the associated project files.
It works, but every time I run into a new project here at work I find myself spending a week or more debugging my console project so that it can churn out a solution for that particular work project.
Is there something out there already that can create a VS solution out of an existing file structure?
As you can tell from my screen capture below, these projects are nested very deep, so it would take a very long time to do this with the apps folder below with the "by mouse" technique in the Visual Studio IDE.
I created the custom console application that is posted in this post:
https://stackoverflow.com/a/22153536/153923
I invite others to contribute how they approached this solution, though.
So, I found out today that this feature already exists in Visual Studio.
Link 1: How to: Create a Project from Existing Code Files
Link 2: How to: Create a Project from Existing Code Files
Basically, though, it says this (just in case the MSDN links get changed or deleted):
You can create a Visual Studio project from an existing app—for example, an app that you obtained from an online source. Project and solution files are created on your computer and the other relevant files are added. A project can be created from Visual C++, Visual Basic, or Visual C# code files.
Security note Security Note
We recommend that you determine the trustworthiness of existing code files before you import them into Visual Studio, because Visual Studio will execute some of the code in a fully trusted process when you open the newly created project.
To create a project from existing code files
On the menu bar, choose File, New, Project From Existing Code.
The Create New Project from Existing Code Files wizard opens.
Use the wizard to specify the details of the existing code files that will be added to the project and the application that will be created when you build the project.
Another good answer was given by cbp in Visual Studio: Create a web application from existing code:
--
OK I figured it out. It's weird, but the following steps will work:
Open fresh copy of Visual Studio
File->New Project, select Web Application
Use the following settings:
Name: Website (this is the name of the existing folder with the website files in it)
Location: C:\Temp\ (anywhere will do for now)
Solution Name: TheProject (name of the existing project's root folder)
Check "Create directory for solution"
Delete the auto-created Default, Global and Web.config files
Save All and close Visual Studio
In Windows Explorer, copy the new folder on top of the existing folder so that the files are merged.
Double click on the sln file to open Visual Studio again.
Select "Show all files" (at the top of Solution Explorer)
Right click on any files or folders you want to add and select Include in Project.
Great idea!

Copy/Move Visual Studio Projects/Solutions To Another Computer

So I have a handful of Visual Studio projects that I need to move to another computer. Is it as simple as a copy and paste or will that mess something up? Both machines will have the same version of Visual Studio installed, so that shouldn't be an issue.
Is there an export function that I've overlooked?
If the Visual Studio version is the same, you can just copy the project folder.
Till the time you are moving your solution file and associated files you should be good.
In case you are using any source control update your solution from there.
Hope you have the same VS version and any addon frameworks you have
You can directly copy the project to the projects folder. This worked perfectly for Visual C++ projects for me (and also some other projects). But when I copied my Cordova App from one PC to the other (Both had Visual Studio 2015), I wasn't able to open the project. Whenever I tried to open the project, trying both the ways - directly from the Project file and the open option in Visual Studio, it at first opened but when I tried to open a file, it just got hung and didn't respond.
This problem may occur because Cordova apps have some configuration files that might be different for different PCs. I am not sure that this is the reason for the problem.
A solution that I used was that I created a new Project and copied the files to the project folders (excluding the configuration files).
Can you save the file to cloud? if so then you could potentially upload the file to cloud and download the file to the new

Add reference deselected in visual studio 2010

I am trying to open a existing project in visual studio 2010 using
new->project from existing code
and selecting visual c# as the language. When I run it, I get errors. Later I heard from the person who created the project that I have to add few references, which are present in the references folder in the project itself. It comes in the side window - solution explorer.
However, when I right click on that folder to add as references, that option is 'greyed', or disabled. How Can I correct this?
The DLLs named freeglut.dll and glut32.dll are not COM or NET components. You cannot add them as references to your project (You have 4 solutions in your archive, I have choosen the one named fwa_annimate but I think the problem is the same).
The DLL named Tao.FreeGlut.dll needs these files in the same directory where you application run to work. So the easiest way to resolve your problem is to select the two DLLs inside Visual Studio and change the property Copy to Output Directory from Copy Never to Copy Always.
In this way, when you start to debug your app, the VS IDE will copy the two files to the BIN\DEBUG or BIN\RELEASE directory where you app runs when launched inside the VS IDE.
Of course, you need to deploy all these file when you distribute your application.
(By the way, I have no idea what is supposed to do)

Resources