0

I'm creating mixed 32-bit/64-bit installers using advance installer, according to this guide Advance Installer Guide for 32-bit/64-bit installers I should seperate 32-bit and 64-bit assemblies. My question is what if my visual studio build is set to "Any CPU", can I use single assembly file for both 32-bit and 64-bit or do I have to create seperate 32-bit and 64-bit assemblies and put them in 32-bit and 64-bit folders in advanced installer.enter image description here

enter image description here

Additional Information:

  • My application does not use any DLL references.
Fawad Naseer
  • 35
  • 10
  • 2
    I think this can be relevant http://stackoverflow.com/questions/516730/what-does-the-visual-studio-any-cpu-target-mean – enkryptor Jul 12 '16 at 16:49
  • That's what "AnyCPU" means, yes. You in general don't need a 64-bit installer at all, most .NET programs that run in 64-bit mode but are installed in a c:\program files (x86) subdirectory work just fine. Try it. – Hans Passant Jul 12 '16 at 16:55
  • 1
    @HansPassant AdvancedInstaller has options in it's setup to support putting apps to the correct folder on both 32 and 64 bit systems from the same installer exe as long as you used `AI_ProgramFiles` as the file location for your files. See "Mixed 32/64-bit matching the platform" from the [installer types](http://www.advancedinstaller.com/user-guide/package-types.html) page. – Scott Chamberlain Jul 12 '16 at 17:48
  • Well, sure, it isn't exclusive to installing .NET programs. – Hans Passant Jul 12 '16 at 17:50

3 Answers3

1

If the assembly uses unmanaged 32- or 64-bit code, you have to compile two respective versions. Otherwise, with "Any CPU" you can use the same assembly for both platforms.

enkryptor
  • 1,574
  • 1
  • 17
  • 27
  • Application works fine on 64-bit windows, but when it's installed on 32-bit windows, app boots up fine, but button does not register any event, it does not cause any problem in 64-bit windows but only on 32 bit windows, do you think I should compile two separate assemblies? – Fawad Naseer Jul 12 '16 at 17:08
  • @FawadNaseer that sounds like some other kind of bug and does not have anything to do with how the installer project was set up. If you compiled a 32 bit only EXE it would likely still have the same problem (I only say this because you said you do not use any external DLLs, if you did my previous statement may not be true) – Scott Chamberlain Jul 12 '16 at 17:46
  • @ScottChamberlain you are correct. I compiled 32 bit exe and installed separately from the advanced installer the problem remains the same. The button does not register any event. – Fawad Naseer Jul 12 '16 at 18:59
  • @ScottChamberlain but the reason I am talking about 32bit and 64 bit assemblies is because on a 64-bit windows 10 the app works fine. Button registers event and everything works normally, it is when the app is installed in a 32-bit windows the button does not register any event. – Fawad Naseer Jul 12 '16 at 19:10
  • @FawadNaseer you should ask a new question specifically about that problem – Scott Chamberlain Jul 12 '16 at 19:17
1

Your project shouldn't go under either of them and should instead likely be put under MainFeature.

The important thing is under Install Parameters you have set the Package Type to "Mixed 32/64-bit matching the platform"

Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
1

You can leave your project building as AnyCPU, and deploy the same assembly to x86 or x64. Advanced Installer's wizard for creating a Mixed Package will ask for files that are x64 only, x86 only, and shared files. Your AnyCPU assembly would be a shared file to deploy for both x86 and x64. Advanced installer puts the shared files in a common component, and the others in their respective 64-bit and 32-bit components.

The Mixed Package uses bootstrapper that contains both an x86 and x64 msi. Another option for deploying your AnyCPU assembly is to create an x86 msi as it would run on both platforms. The x86 msi would deploy your AnyCPU assembly to Program Files (x86), but when run on an x64 machine it would run as an x64 process. Shared Files

mcdon
  • 4,931
  • 3
  • 38
  • 36
  • You have provided me 80% answer for my question. The reason I asked this question because I thought because I am not separating a 32bit and 64bit assemblies this is why I am getting this problem. Problem is whenever my program is installed on a 32-bit windows, program starts up but OK button does not register any event, this problem does not come up when installed on 64-bit windows. Tried on 2 separate PCs that had Windows 10 32bit installed. – Fawad Naseer Jul 13 '16 at 04:40
  • Does the event work if you manually copy the AnyCPU assembly to a 32-bit machine? – mcdon Jul 13 '16 at 14:00
  • This is embarrassing, I found out the bug, basically when the user enter incorrect key, the program does not notify user, there is no error detection there, if the key wasn't valid. It just do nothing, only if the user enters valid key then the program notifies the user that the key is valid and me going crazy thinking if its a 32bit and 64bit problem, . Its a 30-digit key and my users were making typing mistake, coincidentally no-one was copying the key and instead they were typing by handbut thank you so much, you cleared another confusion of 32bit and 64bit assemblies in advance installer. – Fawad Naseer Jul 13 '16 at 14:16