question

Tobias-4331 avatar image
0 Votes"
Tobias-4331 asked Tobias-4331 commented

Walkthrough: Deploying Your Program

Hello,
I have written a program (with Visual Studio --> C#), which I have provided with "Walkthrough: Deploying Your Program"
(https://docs.microsoft.com/de-de/cpp/ide/walkthrough-deploying-your-program-cpp?view=msvc-160 --> To install the setup and deployment project template for Visual Studio 2019 --> Stps 1 to 13).

And I have run and installed the setup.exe file on another PC. But how can I open and use the program now?
Do I need to download a program to run it? If so which one(s)?

Thanks for your help

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

APoblacion avatar image
0 Votes"
APoblacion answered Tobias-4331 commented

So I copy the whole project from my program [...]

This is overkill. You do not need to copy the whole project. Look under the project for a subfolder named bin\Debug (or bin\Release, depending on how you compiled the project). You only have to copy the content of the bin\Debug folder. If there are .pdb files in the folder, you may omit them; they are not necessary.
Once you have copied these files to a folder in the target computer, just run the file that ends in .exe. You can run it by double-clicking it from Windows Explorer, or typing its name from a console window.

This is valid for "Console App (.NET Framework)". And it presumes that the target computer already contains the same or newerversion of the .NET Framework that you selected from the Project Properties. Most Windows versions already have the .NET Framework, but it may be a lesser version than the one selected by default in Visual Studio. If this happens, you need to either install a newer version of the .NET Framework in the computer, or change the project properties to compile for an older version.

If you are doing "Console App (.NET Core)", then things are different. It does not use the Framework. Instead, you need to either install the Core libraries or generate an executable that includes them. This is quite different from using the .NET Framework, so if you need instructions for Core I suggest opening a new thread in the forum.
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thank you very much for your help, it was very helpful

0 Votes 0 ·
APoblacion avatar image
1 Vote"
APoblacion answered

If you followed the instructions in the tutorial (which, by the way, refers to C++, not to C#), then you should have two files: stup.exe and GameInstaller.msi. The GameInstaller.msi is the one that contains your program along with all the information needed to install it. You can launch it by means of MSIEXEC.EXE, which should be already preconfigured in your system so that if you double-click the msi from Windows Explorer it will launch the installer automatically. Or, if you don't want to bother or if your Windows does not have a modern version of MSIEXEC, then you can run Setup.exe and Setup.exe will in turn run GameInstaller.msi. This will open a user interface asking where and how you want to install your program. Once you answer all the questions, the program will be installed on the target machine and a shortcut icon will be provided for it. All the preceding only has to be done once. After you have done it, then you can run your program any time you wish by just clicking the icon.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Tobias-4331 avatar image
0 Votes"
Tobias-4331 answered APoblacion commented

And how can I do this with C#.
That i can use my Programm on another PC?

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, this also works with C#. Even if the tutorial is labelled as C++, the installation project will also generate setup.exe and an .msi for a C# program. It is then installed in the same way.
But if you only want to use your program on another PC you do not need to do any of this. The installer is only needed if you want to do any fancy operations such as creating an shortcut, or deploying additional files or creating file associations. If you only want to run your program, simply copy the executable to the target machine and it will run directly (on the condition that the target machine has the appropriate Framework, be careful about which version you select when you compile). It is not necessary to build an installer.

0 Votes 0 ·
Tobias-4331 avatar image
0 Votes"
Tobias-4331 answered Tobias-4331 edited

Oke, I don't quite understand it yet. I don't know much about this area.
So I copy the whole project from my program.
Which file do I have to execute now to use the program on another computer.
How do I run the program?
And what does it depend on ?


So how should I proceed if I have written a program in Visual Studio (C#) and want to use it on any other computer?

And with which project type can I actually do this, because I have written programs with "Console App (.NET Core)" as well as with "Console App (.NET Framework)"?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.