C# app's installer is installed but doesn't run - c#

I created my application's installer with latest InstallShield (Limited Edition for Visual Studio 2015). In fact, these are two independent but talking applications. Smaller one is just responsible for generating data and sending it over COM port and larger one listens for and processes that data.
Now when i created InstallShield installer for smaller one (which is using a Class Library from larger app), its installer is created quite ok and it's running smoothly. But when i create installer for the larger app, it is created fine but when I click the installed shortcut, it simply doesn't start/run.
This larger app has 3 projects, two are class libraries and the third one is the application GUI and the startup project of my app. In the created installer, both class libraries' .dll files are present. Still the project runs from VS15 and from corresponding .exe but not from the installed shortcut.
Where could i possibly go wrong?

Related

Best way to deploy Winform App with external custom program

I am trying to deploy a Winform Application using a setup wizard. My application runs an external software as a service. This external software is a program built and compiled using CMake/CPack and should be compiled each time on each computer to generate DLLs for the specific computer.
I want to have a global setup wizard to install both the main application and the external program. I have tried two solutions:
Tested Solution 1
I included the already compiled external exe as a file that is added during the installation of my main aplication. The problem is that the external exe doesn't work when testing it on another machine because it wasn't compiled on it.
Tested Solution 2
I have used CPack to generate a setup for my external software. With this method, I can install it and use it on different machines. After that, I included the setup of the external software as a prerequisite of my main Winform. It works but I cannot get my prerequisite installed in the folder of my main application (Cpack force the installation to be in "C:/Program Files/External_AppName".
Any idead to how to deploy this properly ?

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.

WPF and Console Application EXEs in same solution

I have a WPF application that is going to be installed on several client PCs. I'm using InstallShield Express Edition as the deployment tool for that.
I've created a different project(DLL) to keep track of the software installations. Basically is a stand-alone C# project that reads, writes and does some validation checking in the Windows Registries, and can be integrated in other WPF applications (this project/DLL is going to be useful for other Apps).
What I want to do is to create an .EXE file to register the installation. This .EXE is not used in the main WPF application, but uses the .DLL that I've just talked about above.
I've managed to do that by creating a different solution with a single Console Application project, and referencing the necessary DLL's.
But what I really want is to create it as project within my Main App Solution, and when I do that no .EXE file is generated other than the Main App executable.
Is there anything I can do to get the 2 .EXE files (Main App and InstallationRegistration) or is the way I'm currently using the only way?
This is more a nuisance than a problem, but still... it will be a better way to keep track of this small module in all the different Applications I've developed.
Thanks
Are you saying the Console EXE is not created as part of the build/run of the solution?
Or the Console EXE is not created as part of the InstallShield deployment project?
If you are referring to building Console EXE as part of the build/run of the solution:
Generally, when you hit F5, Visual Studio builds only those projects you designate as Startup and their dependencies.
You will have to explicitly build that Console App or the Entire Solution.
You can designate it as one of your Startup projects if you want it to be built everytime you hit F5; or specify it as a dependency of the MainApp project (that's a bit of a cheat but it gets the job done).
After trying for a few different ways I got to that DUH!!! moment.
What happened is that VS was creating both .EXE files for the Main App and the Console Application, only with each one is in their respective Debug/Release Folder
For Example:
Main App -> C:\Projects\MyApp\MyAppUI\bin\Debug\MyAppUI.exe
Intallation Control.EXE -> C:\Projects\MyApp\InstControl\bin\Debug\InstControl.exe
NOTE: C:\Projects\MyApp is the solution folder.
It kinda makes sense they are on their own folder, but on the other hand, there should be an option in VS to choose where we want to send all the solution's .EXE
Hope it helps someone in the future.
By default, all intermediate compilation artifacts are placed in the obj folder under a given project in the solution (so far I am not aware this can be changed).
For project outputs they are, by default, put under bin\Debug or bin\Release depending on your Build Configuration.
This can however be changed from the Project's Properties; specifically the Build tab has an "Output path" option for you to specify the build output location.
This has to be done on a per project basis but I generally create a SolutionDir\bin folder under the Solution root and direct all project output paths to SolutionDir\bin\Debug or SolutionDir\bin\Release as the case may be. This has the added advantage or reducing the total size of SolutionDir by avoiding multiple copies of output assemblies in large solutions with complex interdependencies between projects.
Does this help?

How to make installer package with multiple executables in Visual Studio

I'm making a small backup app that comprises three parts.
A system tray "config" utility where the user specifies backup source / target locations, times they want the backup to run etc.
When changes are made, this calls another exe which creates a scheduled task for the backup. (It's a separate part because this part must be elevated.)
The third part is the exe that performs the backup. (It compresses and uploads by ftp to a server somewhere.) This is the exe that is run by the scheduled task.
How do I package these up (preferably in VS2013, if not using some freeware) so they are all installed together? (They each use a couple of (different) custom dlls. For example the backup component uses DotNetZip and WinSCP, and the scheduling component uses the Win32.TaskScheduler.)
I basically just want the user to run a single installer that will install all three exes and their dependencies.
These are currently three separate projects, with three different solutions. I can combine to one solution if it makes it simpler.
As Louis Van mentioned in this comment You can add one of these executable as primary output to your installer project and the remaining two exes can be added to the installation bin directory using Add > File.. option.
When you add an executable to Application Folder of your installer, References of relevant exe will be detected and automatically included by the windows installer.
You can use the free edition of Advanced Installer (create "Simple" project) to package them up in a MSI. It also includes a VS extension, so you can have the MSI built right out of VS.

Win Form exe closes immediately after launch, deploying a win form application using setup project

I have created a win form application in c# with sqlce. I followed the steps here http://erikej.blogspot.dk/2013/10/sql-server-compact-4-desktop-app-with.html making some tweaks along the way since I was using sqlce 3.5 .net and that blog was talking about 4.0 .net.
When I finished the application, I created a set up project and build it which gave me an msi and setup file.
Now when I run this set up on my own machine where I developed the applicaton, it works a charm.
I tried it on a friend's machine as well, it worked well, he had visual studio 2010 as well on his machine.
Now when I tried it on 2 other machines with VS, after installation, on launching the exe, it launches and immediately closes, I do not see anything although.
I know it launches as i look at processes from my task manager it shows it in there for like 3-4 seconds and its gone.
I tried using this Not able to run the .exe file created from c# where i wrapped the try and catch around all the code inside the root win form but no text file was created with any errors.
On doing some research, it says it could be because I am missing some dll's, how do i make sure all the dlls from the references would be copied into the project ? I set all dll's to true for copy local.
Is this something else and not related to dlls?
I really just want to be able to install the application on any machine without any problems.
Thank you for your time.
EDIT
I need to add that this was a project that involved using an XBox controller sending data to a wireless receiver that was hooked to a PC. I used the XNA framework to intercept these and display some form of output on the Win Forms.
When packing and installing/deploying an application that makes use of the XNA DLLs on another non developer machine, the XNA framework needs to be installed.
My solution was packing my application along with the xna installer and so the xna framework installs as a prerequisite and then my application installs and then it no longer crashes.
Thanks to mrlucmoring and Mark for their support and troubleshooting.

Categories