I have a VS solution in order to build an installer for a Windows Service.
I have the Limited Edition of Installshield, so i can't install windows services. Thus, I use the "Class Installer" Tip in my InstallShield project.
This solution was working until I change of PC.
If I build my Installer on my new PC, with the same solution, same version of Visual Studio 2012 and same version of InstallShield : I have an error message "Error 1001" during installation of my setup.
If I try to install my Installer with InstallUtil.exe, I obtain a BadImageFormatException (both with Framework x86 or x64).
In the new exe of my Installer what doesn't work, the DLLs are the sames than on my older PC, but the MSI is not the same.
You have an architecture bitness mismatch somewhere in your calling sequence.
Heath has a good explanation here that still applies to later VS editions as far as i know.
http://blogs.msdn.com/b/heaths/archive/2006/02/01/64-bit-managed-custom-actions-with-visual-studio.aspx
Also, if any of your code is AnyCpu then it will start out as 64-bit and be unable to link to any 32-bit Dlls, but your issue seems to be at the first call in the custom action.
If you can avoid VS installer classes then do so.
Related
How to use dotfuscator to obfuscate Windows service?
We have created windows service application that includes multiple DLLs (custom as well as third party dlls) and we use installshield to create exe and we distribute the same.
We would like to know on how to start with obfuscate using dotfuscator.
As far as we reviewed, it looks like we will not be able to obfuscate the entire windows service exe and we will be able to individually obfuscate each dll. But not sure how to add these dlls while creating the service exe.
If someone can guide on how to obfuscate the windows service exe created using the install shield.
When we tried to all the exe file created using the installshield, we are getting the following error.
Invalid input assembly C:... . This is not a managed module. (C:...)
But when I tried a individual DLL it is able to obfuscate but the ouptut is in different folder. So we are not sure how to automated this entire process.
Environment: Visual Studio professional 2012, Dotfuscator version - 5.5.45x
We have not registered with Dotfuscator and we using the Dotfucator that is part of visual studio.
I work on the Dotfuscator team and am answering as part of my job.
It sounds like the EXE generated by InstallShield is not a .NET assembly, but a native executable. You can verify this by trying to open the EXE in a .NET disassembler/decompiler like ildasm and seeing if that also gives you an error.
I'm not too familiar with the way InstallShield operates when creating a Windows Service, but it sounds like you create the DLLs first, and then InstallShield takes those DLLs to create the installer package? In that case, you should run Dotfuscator after you create the DLLs, but before InstallShield consumes those DLLs. Then is it possible to configure InstallShield to use those obfuscated DLLs instead of the original ones?
With Visual Studio 2012 you have to run a Dotfuscator Project's build from the Dotfuscator Community Edition (CE) user interface (that you open from Visual Studio's Tools menu). Newer versions of Dotfuscator CE Visual Studio 2015 and Visual Studio 2017 can build from the command line interface once you've set up a Dotfuscator Project in the user interface. For automation, you could set up your build scripts to call this interface.
I am running VS professional 2015 on my Windows 10 professional, and I needed to install the Crystal Reports runtime on my computer so I can build projects with CrystalDecisions.CrystalReports.Engine and CrystalDecisions.Shared, version 13.0.2000.0.
I also currently have Crystal Reports 2008, version 12.0.0.683 installed on my computer to create reports outside VS 2015.
On our company server, there was a .msi file and a .exe file. Like an idiot, I ran the .msi file without knowing:
To integrate "SAP Crystal Reports, developer version for Microsoft Visual Studio" into VS 2010 or 2012 (SP 7 and higher) or VS 2013 (SP 9 or higher) or VS 2015 RC (SP14) - VS 2015 (fully - SP 15), you must run the Install Executable. Running the MSI will not fully integrate Crystal Reports into VS. MSI files by definition are for runtime distribution only.
So after running the .msi file and realizing my mistake, I ran the "Uninstall" option from the .msi file and checked my GAC. The CrystalDecisions has been uninstalled from my "GAC_32" and "GAC_64" folders. However, the strange part is that in my "GAC_MSIL" folder, it has the CrystalDecisions version 12.0.2000.0.
GAC_MSIL folder - but no CrystalDecisions folders in GAC_32 or GAC_64
I checked my Control Panel -> Programs -> Programs and Features and nowhere can I find "SAP Crystal Reports runtime engine for .NET Framework (64-bit)" and "SAP Crystal Reports, version for Microsoft Visual Studio", so I figured the uninstall was successful.
When I try to run the .exe file this time, I get an error saying that it cannot run the installation due to the following error:
SAP Crystal Reports runtime installation error window
So I checked EventViewer -> Windows Logs -> Application, and the error log said it was an error at installation 1603 and "Product: SAP Crystal Reports, version for Microsoft Visual Studio -- You must already have Visual Studio 2010 or Visual Studio 2012 installed to proceed with this installation."
I talked with my boss and he said he doubts I need VS 2012 and it does not make sense to have both VS 2012 and 2015 on my computer. Unfortunately, I cannot build projects using CrystalDecisions v.13 like our production server, and building the project using the CrystalDecisions v.12 on my computer will cause the project to fail if I release it to production.
I checked other questions on StackOverflow, and I saw some solutions:
Install VS 2012 - not an option unless a last resort; we have VS 2015 only - unless if installing a "community" version of VS 2012 would do the trick.
Do a system restore - one person suggested because I ran the .msi file instead of the .exe, it messed up my assembly, so doing a system restore before I ran the .msi file could fix it and allow me to install CR runtime correctly, but again, my boss says he wouldn't recommend it
Try running the CR runtime setup from the SAP website with a newer version other than v.13 for my x64 bit machine that will integrate with VS 2015 without needing VS 2012 - then the newer version of my CR runtime when I build my projects will be different from the CR runtime on the production server and there will be conflicts when I release my project on the production server.
Alter/delete my assembly files because running the .msi file screwed up my assembly cache - Really risky; I don't know the first thing about assembly files and I could mess up my computer. And would deleting manually the "CrystalDecisions" folders from my "GAC_MSIL" folder even work if the GAC_32 and GAC_64 folders do not have "CrystalDecisions"?
None of these solutions are preferable, so does anyone have any other solutions I cannot see that work?
Thank you for your patience. I could just bash my head against the desk because I ran the .msi file instead of reading the directions carefully. I feel like an idiot...
To all those who are wondering, my boss and I fixed the issue and it was incredibly simple!
It turns out that we needed some Visual Studio 2012 tools installed on the computer before running the executable. We needed to install those SDK libraries in Visual Studio 2015 before running the installation of the "CRforVS_13_0_6.exe" file.
So I went to "Control Panel" -> "Programs and Features" -> selected Visual Studio Professional 2015 and clicked the "Change" button to go to the following menu:
Installing new Visual Studio 2015 SDK Features
We checked the "Windows 8.1 and Windows Phone 8.0/8.1 Tools" and made sure "Tools and Windows SDKs" was checked.
After updating, I restarted my computer and tried to run the Crystal Reports v13 for Visual Studio .exe again.
It worked!
So it looks like my boss's doubt was incorrect; you do need some VS 2012 components to run the CR v13 installation for Visual Studio!
Putting this here for future reference!
I have two machines:
- dev machine --> Win 10 64-bit with Visual Studio 2015
- test machine --> Win 10 32-bit machine without Visual Studio (no version is available)
I have developed DB & Web API apps on 64-bit machine and would like to compile those projects on 32-bit machine.
I have installed Win 10 SDK and also VS 2015 build tools but after those installations, 32-bit machine doesn't have following:
Program Files\MSBuild\Visual Studio
Without those, I can't run my batch files to compile those projects. Any idea how do I get those MSBuild related files? (in my 64-bit machine, I can see SSDT & WebApplications folders which are necessary for compiling DB & Web API projects and I need same on another machine.)
First off, Visual Studio (VS), SSDT, and MSBuild are separate but related applications. VS installers don't so much install just VS but the typical VS suite of apps which includes MSBuild for most flavors.
If you're setting up a 'build machine' and want to manually shoot over builds to MSBuild, you can use this Microsoft Build Tools 2015 https://www.microsoft.com/en-us/download/details.aspx?id=48159
However, if you're getting a continuous integration set-up up and going, there are a bunch of options and services. visualstudio.com has some options.
I personally like TeamCity (Subversion, Test & Build) + Octopus Deploy (pushes builds to the right environment).
Team City can be set-up for a variety of version control and build runners. The free/intro version is full-featured. Octopus' intro version will work for small teams. Both products are well-supported and documented.
we recently began to use Team Foundation Build Server 11 Beta with a build agent on a Windows Server 2008 R2 system without having Visual Studio installed on this system. Everything works fine.
When including new Visual Studio 11 Beta Portable Libraries in our solution, problems started.
MSBuild was not able to find included
C:\Program Files (x86)\MSBuild\Microsoft\Portable\v4.0\Microsoft.Portable.CSharp.targets
on the build agent system.
We copied the missing files from a second system but now we get a build error
".NETPortable,Version=v4.0,Profile=Profile47" not found.
How to build Portable Library on Team Foundation Build 11?
Best regards,
Björn
http://msdn.microsoft.com/en-us/library/gg597391.aspx
To install the Portable Class Library Tools on a build machine without
installing Visual Studio 2010, save the download file
(PortableLibraryTools.exe) on your computer, and run the installation
program from a Command Prompt window. Include the /buildmachine switch
on the command line.
Have a project that was created in Visual Studio 2008 and deployed to a 64-bit Windows 2003 server. This application references a 32-bit Interop.ActiveDs.dll. The applications were originally compiled for 'Any CPU', however, explicitly compiling as 'x86' doesn't solve the problem. The project targets the 3.5 framework.
The server is running IIS 6.0 in 64-bit mode. When we deploy the version compiled in Visual Studio 2008, the app runs perfectly fine; all pages show up. In retrospect, this is actually surprising.
We migrated the application to Visual Studio 2010 (we did not change the targeted framework) and redeployed. Now we get a BadImageFormatException loading Interop.ActiveDs.dll. Which actually makes more sense than the 2008 version running.
To solve the problem, we set Enable32bitAppOnWin64 to true and ran aspnet_regiis.exe -i from the 32-bit folder of the 2.0 framework (as per various instructions on the web). In IIS, web service extensions, there were two versions of ASP.NET 2.0, one for 32-bit and one for 64-bit. We prohibited the 64-bit version, restarted IIS, and launched the website.
What we expected: The app to run as 32-bit, load the interop, and display
What we got: "Service Unavailable"
All other web pages that were previously working displayed the same message, as did the Visual Studio 2008 version.
The support page here describes the problem exactly, but tells us to do exactly what we did to resolve the problem (enable 32-bit mode).
We've rolled back to 64-bit mode in IIS and deployed the Visual Studio 2008 version for now, but we really need to figure out how to make this app run and load the interop (there are also 32-bit Oracle DLLs that are referenced)
Two questions:
Why does the Visual Studio 2008 version work at all??
How do we get the Visual Studio 2010 version to work? And what is 2010 doing differently that causes the issue?
Thanks in advance!
James
This can happen if you have one DLL compiled for 64-bit and another in 32-bit. Check through all of your references and look for those that do not have 64-bit versions. If you can't find 64-bit versions of your incompatible DLLs, you will need to compile in 32-bit mode.