-
Jul 10th, 2018, 11:25 AM
#1
Thread Starter
Hyperactive Member
Confused about Active Solution Platform
I'm done with my project but so confused about what type of active solution platform I should build the released project with, because I'm targeting many and different users with different platforms.
The .exe program needs an Access Database Engine or (Microsoft.ACE.OLEDB 12.0 Provider) and for that I decided to make an installer that could provide all needed (Microsoft.ACE.OLEDB 12.0 Provider) for x64 and x86 and also for MS 2010 while there is a specific Provider only for MS 2010 trying to avoid any further problems could happen.
This picture of the installer I decided to make could explain more:
So did I do the right thing to avoid future problems?
What if I just release it in Any CPU Platform? Would it work for Any CPU Whether it's x64 or x86?
Any suggestions are really appreciated.
Last edited by Joye; Jul 11th, 2018 at 08:45 AM.
-
Jul 10th, 2018, 06:54 PM
#2
Re: Confused about Active Solution Platform
If you need to be able to connect to an Access database for any user then you need at least two editions of your application.
If you set the target platform to x86 then your application will run on both 32-bit and 64-bit editions of Windows in a 32-bit process. That will work for the vast majority of users and the vast majority of users with Office installed will have the 32-bit edition of Office (that is what Microsoft recommends). If users don't have Office installed, you should install the 32-bit edition of ACE for best compatibility with future Office installations.
If you set the target platform to x64 then your application will only run on 64-bit Windows and only work with 64-bit Office or ACE.
If you set the target platform to Any CPU and check the Prefer 32-bit box (which is the default in VS 2017) then your application will behave as though the target platform was set to x86 on most Windows systems. Only on those that don't support 32-bit apps will it run in a 64-bit process, in which case Office or ACE would have to also be 64-bit anyway.
If you set the target platform to Any CPU and uncheck the Prefer 32-bit box then the application will run in a 32-bit process on 32-bit Windows and in a 64-bit process on 64-bit Windows, which means that it will not work with 32-bit Office or ACE on 64-bit Windows.
So:
1. You need an edition of your application that will run on 32-bit Windows, which means targeting x86 or Any CPU with Prefer 32-bit checked.
2. You need an edition of your application that will run on 64-bit Windows and work with 32-bit Office or ACE, which means targeting x86 or Any CPU with Prefer 32-bit checked.
3. You need an edition of your application that will run on 64-bit Windows and work with 64-bit Office or ACE, which means targeting x64 or Any CPU with Prefer 32-bit unchecked.
I would recommend building once against Any CPU with Prefer 32-bit checked. That will work for the vast majority of your users. I would also recommend building once against Any CPU with Prefer 32-bit unchecked. You can instruct users that they must install that edition if they have 64-bit Office installed, but it will still work on 32-bit Windows too.
-
Jul 11th, 2018, 09:17 AM
#3
Thread Starter
Hyperactive Member
Re: Confused about Active Solution Platform
Wow!! This is really informative and helpful.
I'm working on it, testing on many CPU's and will give back results.
One more thing:
If users don't have Office installed, you should install the 32-bit edition of ACE for best compatibility with future Office installations.
Does that mean Microsoft.ACE.OLEDB 12.0 Provider installed by default with Microsoft Office?
Because I thought user will need to Install it if he doesn't have Visual Studio installed for example.
Thank you again jmcilhinney
-
Jul 11th, 2018, 09:45 AM
#4
Re: Confused about Active Solution Platform
Database providers (such as Microsoft.ACE.OLEDB) are generally installed by the database system itself (or the tools that come with it), or by other applications that need the providers. In the case of ACE, it is basically for Microsoft Access based databases, so installing the provider with Office makes sense (even if the edition of Office doesn't include Access).
I'm not sure if the ACE provider is installed by Visual Studio (it would be convenient for some developers/users, and doesn't cause any legal/financial problems, so it would make sense for Microsoft to do it), but it certainly isn't normal for Visual Studio to be the source of installing database providers.
In some cases (such as Microsoft.JET.OLEDB) the provider is pre-installed with Windows, but generally you should install providers that your application needs (unless they are already installed on that system).
In the case of ACE you should expect the user to install Office at some point (because a decent percentage of people do), so installing the 32 bit is a good way to go (because that is what the majority of users will install, and shouldn't break your program when they do).
-
Jul 11th, 2018, 10:14 AM
#5
Thread Starter
Hyperactive Member
Re: Confused about Active Solution Platform
Originally Posted by si_the_geek
Database providers (such as Microsoft.ACE.OLEDB) are generally installed by the database system itself (or the tools that come with it), or by other applications that need the providers. In the case of ACE, it is basically for Microsoft Access based databases, so installing the provider with Office makes sense (even if the edition of Office doesn't include Access).
I'm not sure if the ACE provider is installed by Visual Studio (it would be convenient for some developers/users, and doesn't cause any legal/financial problems, so it would make sense for Microsoft to do it), but it certainly isn't normal for Visual Studio to be the source of installing database providers.
In some cases (such as Microsoft.JET.OLEDB) the provider is pre-installed with Windows, but generally you should install providers that your application needs (unless they are already installed on that system).
In the case of ACE you should expect the user to install Office at some point (because a decent percentage of people do), so installing the 32 bit is a good way to go (because that is what the majority of users will install, and shouldn't break your program when they do).
That's just great
So providing 32-bit ACE will be the safest thing I should do for the vast majority?
Okay, then I need to know if the Ace provider is already installed? Is that possible by code to determine? where I can tell the user that he doesn't need to install it and he already has 32-bit or 64-bit provider on his machine?
Last edited by Joye; Jul 11th, 2018 at 11:26 AM.
-
Jul 11th, 2018, 12:21 PM
#6
Re: Confused about Active Solution Platform
You would do that through the installer. Usually there are ways to tell the installer to install things if they don't already exist -- they're called pre-requisites... so if you set up the drivers as a requisite of your app, during installation, the installer will first check for it, if it doesn't find it, then it will install it. You shouldn't have to do anything other than that.
-tg
-
Jul 11th, 2018, 12:41 PM
#7
Thread Starter
Hyperactive Member
Re: Confused about Active Solution Platform
Originally Posted by techgnome
You would do that through the installer. Usually there are ways to tell the installer to install things if they don't already exist -- they're called pre-requisites... so if you set up the drivers as a requisite of your app, during installation, the installer will first check for it, if it doesn't find it, then it will install it. You shouldn't have to do anything other than that.
-tg
That's even better. Thank you
Now I need to look for that installer??
any recommendations.
-
Jul 11th, 2018, 08:34 PM
#8
Re: Confused about Active Solution Platform
As suggested, the Jet provider, which can be used to connect to the old Office file formats (MDB, XLS, etc) as well as text files, is basically part of Windows these days while the ACE provider, which can be used to connect to the old and the new Office file formats (ACCDB, XLSX, etc) as well as text files, is part of Office. It is not installed with Windows or by Visual Studio, but there is a standalone installer available for those without Office. If you are going to install ACE with your app, you may like to give users the choice but I'd suggest that installing the 32-bit edition is the safest bet because, if they ever do install Office, it's more likely to be the 32-bit edition.
As for your own installer, VS originally included a project template that would build a Windows Installer for your app, complete with MSI file and Setup.exe. I think it was in 2010 that they dropped that and included InstallShield LE, which was a third-party product. For whatever reason, that has now been dropped and Microsoft provide a VS extension that basically replicates the functionality of the old built-in project template. You can download that here or install it through the Extensions & Updates dialogue in VS.
I haven't created am installer using that extension but I did using the old built-in project template and that worked much like publishing a ClickOnce installer as far as providing installers for prerequisite components. I assume that this extension is the same, in that you can choose things like a .NET Framework version, SQL Server Express and more to be installed from packages included with your installer. Those packages each have their own installer that gets executed by your main installer. You can create your own packages for components that you want installed with your app and I would think that you could do that for ACE. You can learn how here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|