Walkthrough: Deploying Your Program

Tobias 21 Reputation points
2021-04-04T08:20:43.573+00:00

Hello,
I have written a program (with Visual Studio --> C#), which I have provided with "Walkthrough: Deploying Your Program"
(https://learn.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

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,099 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alberto Poblacion 1,551 Reputation points
    2021-04-04T16:10:48.64+00:00

    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.


3 additional answers

Sort by: Most helpful
  1. Alberto Poblacion 1,551 Reputation points
    2021-04-04T08:56:28.26+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

  2. Tobias 21 Reputation points
    2021-04-04T10:52:13.74+00:00

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


  3. Tobias 21 Reputation points
    2021-04-04T13:36:33.067+00:00

    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)"?

    0 comments No comments