-2

I'm working on WPF application based with Local database. My Question is how can I convert it into such application which would run on all PC (Windows OS. I tried to transfer whole project folder into another PC and tried to run exe (debug/bin/application.exe) but it did't work.

I'm working on Visual Studio 2013 with .Net Framework 4.5..

Thank You

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
Soft Mail
  • 15
  • 1
  • 2
    You've got quite a lot of work ahead of you. First you need to update to a later version of Visual Studio. Then you need to learn how to create an installer using a tool like WIX or Advanced installer. Investigate these tools. Build some example installers. Test them on all Windows versions you want to support. If you run into problems, post the install scripts to Stack Overflow, tell us what you think they should do, then show us what is going wrong. – Dour High Arch Mar 31 '19 at 16:51
  • 1
    As Chris said: `1)` work out obvious dependencies such as .NET, Java, etc... `2)` Then [test and choose a deployment tool](https://stackoverflow.com/a/50229840/129130), `3)` package it all up in an MSI or some other format, `4)` test on virtuals or clean systems and if need be `5)` debug dependencies ([hardcore using procmon or using visual studio](https://stackoverflow.com/q/55413716/129130)). And `6)` finally some ideas to work around: [**Common application launch problems**](https://stackoverflow.com/a/53530377/129130) and [an older alternative](https://stackoverflow.com/a/49637913/129130). – Stein Åsmul Mar 31 '19 at 17:41
  • [And throwing in a link to an older answer on a similar topic](https://stackoverflow.com/a/52731324/129130). – Stein Åsmul Apr 01 '19 at 03:56

2 Answers2

3

In my experience, deployment engineering is two phases:

1) Dependency Analysis: What does my application need? .NET? Java? SQL Server? IIS? Files\Folder copied? Configuration setting. Shortcut?

2) How to implement/develop automation to achieve those things.

You say you copy the files over and it wont' work? That means you need to spend more time on dependency analysis.

For #2, I would start here.

https://github.com/iswix-llc/iswix-tutorials

IsWiX is an open source project that I maintain that makes it a lot easier to get up to speed on Windows Installer XML.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • For simple projects, working out #1 manually by hand is fine. Use a virtual machine of a clean install of windows that has been snapshotted for easy rinse and repeat. Install dotnet and take another checkpoint. Copy your files manually and worth things out until you have the recipe and then begin the process of creating an MSI/EXE to automate that. – Christopher Painter Apr 01 '19 at 11:05
  • For complex projects you do the same as above except you start creating your installer project as you go along. The ideal is that a CI/CD pipeline always creates a shipable product. Update the MSI as you add additional features to your product to avoid building up technical debt. – Christopher Painter Apr 01 '19 at 11:06
1

A WPF application made with .NET implies that it needs a .NET framework to be installed on the target machine. You will not be able to write your own WPF / C# installer application that is able to work on PCs without it.

You could try one of the many third party installers found on the web (e.g. http://dblock.github.io/dotnetinstaller/) or use the VS installer functionality (see Build an installer). I am not sure about the latter, never used it.

Udontknow
  • 1,472
  • 12
  • 32