In VS2012, I've created an Wix3.6 setup project for an application. The installer output type is set to Executable Package (.exe) on the Properties tab. The setup project compiles and produces an .exe as expected.
Double-clicking the .exe produces the message:
This app can't run on your PC.
Executing the .exe as Administrator and granting elevation, the machine says:
Windows cannot find 'C:\abc\xyz.exe'. Make sure you typed the name correctly, and then try again.
Googling reveals the error message is likely architecture related.
Facts:
Machine is Windows 8, 64-bit.
The setup project is set to an x86 platform.
The same setup project produces a working x86 .msi
Any ideas about incorrect settings, references or configurations to look for?
A bit late but I came across this myself and this is my solution.
Basically, this scenario can be created by trying to change a WIX setup project from 'MSI' output to 'EXE' in the project settings. A WIX setup project can only generate an MSI from it's Product.wxs. A WIX-generated EXE is actually created with a bootstrapper project, containining a Bundle.wxs, which then in turn can bundle your MSI(s) internally into a bootstrapped EXE.
So to solve this change your setup project back to MSI output, then create an additional bootstrap project (with EXE output) and add your build MSI output from the setup project in the "Chained packages" section of the Bundle XML.
Related
I have a Windows service application and am trying to add an MSI project to the solution. Application uses 64 bit Oracle Data Access DLL and is built as 64 bit app.
I added new "Project Setup" project to the solution and went through the steps. There are two other DLLs in the application project: log4net.dll and System.Net.Http.dll.
Windows Service by itself worked fine. When I try to build the solution, I get File 'Oracle.DataAccess.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86' error. I checked for this error and every article said to set the taget platform of installer to x64, which makes sense. The only thing is when I open the properties window of installer project, there is no option to select target platform and it is blank.
This is screen shot of "Application Folder" section of installer:
This is the installer properties:
This is the Windows service application's properties:
Procedure: You need to set the MSI architecture in the setup project's properties window. This is a different property page than the one you show.
Left click the Visual Studio Installer Project inside the Visual Studio Solution.
Press F4 to go to the property page for the project.
In the TargetPlatform select x64.
Tip: Try googling the exact error message you get when you face issues like these. Here is a previous answer: Can't set 64 bit target for Setup Project in Visual Studio 2017 (I added a new one to get a screen shot in).
Heads-Up: And a heads-up on the use of Visual Studio Installer projects. They have many limitations: Visual Studio Publish Project Into One Simple Installer.
MSI Tools: Here is a quick overview of other MSI tools. And here is a detailed overview / review.
Links:
Troubleshooting Setup and Deployment Projects
I have a Setup Project for my winforms application. After installing the application using the generated .msi i navigate to the installation folder and try to run the .exe file and nothing happens. I don't get an error or anything.
Steps i've tried to solve my problem.
Making sure the target platform x86 matches in the main project, setup project and every other project in the solution that the application has a dependency on.
In the setup project, made sure that i have a project output in the application folder that references the primary output from the main project. And that the dlls i use also are listed there.
Ran the application as administrator.
Activated Click Once security settings in the main project.
Ran sfc /scannow without finding any issues.
Restarted my computer.
When installing the program using the generated .msi on another computer i have the same issue.
When running the program from visual studion it works perfectly fine.
It is likely that your application is crashing because of some missing dependency.
Possible reasons:
A missing assembly (say, for eg, is all your third party dependencies present in the application folder after the installation ?)
Difference between .Net framework versions between your machine and the installed machine (say, for eg. 4.7 vs 4.7.2)
One useful tool that has helped us in the past is to use the Windows Event Viewer. If the program is indeed crashing, it is likely to have details about the reason for crash.
You can then use it as a starting point for further investigation.
I have a console application built in visual studio 2010.
When I actually build the project I am getting .exe file under \bin\Debug\MyProj.exe.
When I Paste and run this .exe from other location it is expecting other files too.
Any thoughts how can I make this as Stand alone exe file.
There should be other DLL's in the Debug library. You need those to run your exe.
If there are no DLL's there, make sure you set the 'Copy local' property of the required references to True, and build again.
If you want to make a standalone program, you should create a new Setup project in your solution. Include the Primary Output from your application project, and the setup should include the required DLL's automatically. Once you build the setup project, you can install your application as a standalone software.
You usually distribute application with bunch of DLLs, that's nothing bad.
But if you really want to make it a single exe, you can look here - same question is answered Embed .net dll in c# .exe . (Valid if your DLLs are also .Net assemblies)
Edit: If you need to easily distribute app to not-very-computer-friendly users, consider also trying ClickOnce. It's roughly something like Java Web start - only disadvantage is that you can't get "Windows Logo" certificate from Microsoft for projects distributed that way.
I don't have Visual Studio 2010 to experiment with, but in Visual Studio 2019 this worked:
Project Properties->Configuration Properties->Advanced->Use of MFC->Use MFC in a Static Library
I am using Visual Studio 2013/ISLE to create a C# program with a .msi install image. When I run install from VS the program is installed in the expected location, e.g. c:/Program Files (x86)/...
I'm sure that this is something simple but I can't figure it out. A pointers would be greatly appreciated.
When you run a 32-bit installer in x 64-bit system Windows will always redirect your installer writing to c:\Program Files to c:\program files (x86). If you want to install to the non-x86 folder you will need to provide a 64-bit installer for your application.
This blog post explains why Windows does this.
It looks like InstallShield LE will allow you to write to the correct folder when your project is set to AnyCPU, but for more advanced scenario's you'll need to use the Pro version or the free Wix installer.
I assume the question is why the installation MSI fails when you run it outside of Visual Studio, but works when VS launches it?
If yes, you should first check if your ISLE project is creating an MSI or an EXE bootstrapper (that also contains the MSI). If an EXE is created this is what you should launch manually, not the MSI. In theory, a bootstrapper can act like an initialization support for the MSI and specify default values for certain properties, like an installation folder, etc...
I say in theory because I am not very familiar with ISLE, I work with other setup authoring tools, thus cannot say for sure if this stands for ISE projects too.
I am developing windows forms application in C#. It always produced .exe in \bin\release. But now it is not creating .exe file for this specific project. There is no error and even warning. I also checked the the build output folder and is the same. I tried build and rebuild solution. if I open other project and run it creates exe.
build options:
configuration= active release,
platform= active any cpu,
output folder= \bin\release,
generate serialization assembly= auto,