C# MVVM WPF Create setup project - c#

I've created a WPF project using MVVM pattern and another project for a web service.
In my WPF project, i've some views and I can navigate between them, everything works.
Now, I want to create a setup with InstallShield, I add project outputs, etc... but when I install the application, the buttons in the main view are not working as if the viewmodels were not include in the setup.
Any ideas ?
Thanks.

Where your installation does not give you the correct results, ask yourself the following questions. Move to the next if you answered 'yes'. If no, then that is a good starting point for your investigation:
Does it work in Release mode on your development PC?
Did the installed application load?
Are all your project outputs present in the installation directory?
Are all the installed files the right version?
Are your configuration files valid?
Have the correct version of the dependencies been installed? (.net version, etc)

Related

Creating Exe/MSI for C# Windows Forms using Visual Studio 2017 Setup Project

I'm trying to create exe/msi for my solution
it contains the following Projects
ActiveDirectoryEngine: library used to implement AD operations
ADService: windows service - performs the work in the background
CryptographyEngine: library used to encrypt/decrypt data
TerranovaActiveDirectoryHost: Dashboars/win form to manage/check the service's status
SyncToolSetup: the setup project "it only targets TerranovaActiveDirectoryHost"
Here is the contents of the Setup project:
I tried the same steps for different Solution, with ONLY one windows forms application, and it worked fine, but it looks that it doesn't work when I have more than one referenced projects.
The install and Uninstall options are not enabled
Update:
all the previous projects are referenced in the Win forms project, so am I targeting the right one when creating the exe/msi?
The only project with the Install option is the setup project. Other projects in the solution do not have install option just because there is a setup project as part of the solution.
References in a non-setup project (such as a C# build) are not automatically included in a setup project. References used to build code are not necessarily things that need installing on the target system. The setup will try to help with dependencies, but it's unreliable, and only a guide. For example, your Application Folder view contains some files that are part of the .NET Framework, and you definitely don't install them because they are installed as part of the standard .NET framework install.
The setup project must be told what needs to be installed on the target system. There are generally two ways of doing this:
Selecting project output as input to the setup project. This can be rather indeterminate because it's not always obvious what files are included, or what to do if the files need installing to different locations.
Add the files that you know you need one at a time by adding them in the File System view of the directory they need installing into. Typically, executables go into the Application Folder (defaults to Program Files..), data files to User's Application Data, shared files to Common Files folder, some assemblies to the GAC and so on.

Automatize archiviation process of an app in Xamarin.Forms

The project that I'm currently developing consists in two different sub-projects: a xamarin.forms application and an aspnet core project used by the first. For now I need only the android version of it, so let us focus only on this aspect. The aspnet project should be able to provide a page where the user can download the .apk. For now I've put the .apk file in a folder in the web project directory and all works perfectly. What I want to accomplish now is to automatize this process: everytime i compile the entire solution, the system itself should prepare the apk package and put it in the right folder. At first it seemed easy, but I've not found a way to do it. Doesn't anyone have tried this, yet? Thanks!

Deploy a WPF application with .NET 3/3.5 in a single executable

I have developed a WPF application and the customer is planning to deploy the application on DVDs.
My application is really simple and doesn't require any setup process, but I need to assure that if the client doesn't have .NET 3 installed that it will be installed locally (from the DVD) before starting the WPF application.
So, what's the easiest was to add the .NET 3/3.5 package locally on my DVD and assure it'll be installed before running my application? Remeber that my application will be a standalone application.
when you use the publish option...
The Project Properties has a place to specify the dependancies that will need to be downloaded
then you simply check the boxes
there are other more complex ways to go abaout this but for .net 3.5 you don't have to go far
I would suggest using Visual Studio Setup Project for creating a setup package which would check for prerequisites and provide fundamental features like file system, registries, scripting. It is very easy to get started with. Take a look here for a brief walkthrough.

C# How to create a Setup project for a Windows Service to install it automagically?

I have seen multiple Windows Services getting installed in my computer with just an Setup.exe or .msi... is it something special that it needs to be done with the setup project to let such Windows Services installed in a easy way without Installutil.exe?
I have tried and it just doesn't install the Service. I know how to use Installutil but that I would think it's just for testing. I need to be able to install my windows service with an Setup.exe because I want to distribute my Service with its configuration Tray app.
What would be the correct way to install the service and then my app? They both use a same DLL created in the same solution.
Problem while Building a Setup Project for a windows Service?
I looked at the link above but its about the Setup Project which I already know how to do, the problem is how to make my Setup project working... my DLL is getting up in place, the Tray app is working as well, the problem is the Service not getting installed it is just giving me the .exez
but I need it to be installed correctly like be up and running at reboot and in the Service Control Manager.
Option 1
1. Download Wix
2. Download and install Wix Windows Service Setup Project Template
3. Create a new wix setup project and see what you get
This is the easiest way to create a *.msi without any option windows
Option 2
Follow this blog post. Same as option 1 but without the project template. If you go the WiX route sooner or later you will see that the project template provides basic stuff. If you want more advanced stuff you need to learn WiX a little bit and use its candle.exe, light.exe, pyro.exe etc.
Option 3
I wrote a short post how I usually do this.
Good luck
Here is a simple template for creating a *.msi installer for a Windows Service with WiX:
http://www.schiffhauer.com/wix-template-for-installing-a-windows-service/
I was able to specify my DLL dependencies with File tags.

visual studio application deploy

I'm trying to create an installer for my application (win form) by visual studio, creating a new project type setup, and am having great difficulty in doing so, for example:
1 When I create the installer and run it installs, but there is the option to uninstall? and I can not install the same application because it already exists on the machine.
2 In dialog window, I see you have the options to create multiple screens and add textbox for example, but where do I set the events of that textbox?
3 º This application works with sqlserver, and I can install it on the machine by the installer, but as I set him to work with my application linq, since I would have to modify the connection string on each machine that I will install the application.
I've researched a lot about these issues and I find no documentation that can teach me how to do this, if anyone knows some please show me,
I appreciate those who can help me, and sorry my english.
I answer your first question at this time due to the lack of time:
In VS, right click the setup project. You have 2 options: Install and Uninstall.
1.) You need to uninstall the program through your operating system. Go to the Control Panel, Programs and uninstall it. Then you can try installing the application.
2.) In design view you can double click the textbox. You will be taken to the method that handles the “TextChanged” event. Write your code there.
3.) If you are installing on a server you need to create a Web Setup project instead of a Setup project. The latter installs files into the file system of a target computer; whereas, the former installs into the virtual directory of a Web server.

Categories