Add Microsoft Access Database Engine 2010 as prerequisites in Setup project - C#
In this article we will see how to add Microsoft Access Engine 2010 as prerequisites in Setup project.
- Download Microsoft Access Database Engine 2010 Redistributable Package from this official link of Microsoft. There are 2 files and you've to download both and the following steps you have to do.
- Create a folder and name it MSAccessDBEng2010. Copy those files you downloaded into this folder.
- Create an XML file and name it product.xml inside of MSAccessDBEng2010 folder.
- Add this code into product.xml.
<?xml version="1.0" encoding="utf-8" ?>
<Product
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
ProductCode="Access.Database.Engine.2010"
>
<!-- Defines list of files to be copied on build -->
<PackageFiles CopyAllPackageFiles="false">
<PackageFile Name="AccessDatabaseEngine.exe" HomeSite="http://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine.exe" />
<PackageFile Name="AccessDatabaseEngine_x64.exe" HomeSite="http://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine_x64.exe" />
</PackageFiles>
<RelatedProducts>
<DependsOnProduct Code="Microsoft.Net.Framework.2.0" />
</RelatedProducts>
<InstallChecks>
<MsiProductCheck Property="IsInstalled"
Product="{90140000-00D1-0409-0000-0000000FF1CE}"/>
</InstallChecks>
<Commands>
<Command PackageFile="AccessDatabaseEngine.exe"
Arguments='/passive'>
<!-- These checks determine whether the package is to be installed -->
<InstallConditions>
<!-- ByPass if the Processor is not x86 -->
<BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel"/>
<!-- ByPass if we have installed -->
<BypassIf Property="IsInstalled" Compare="ValueGreaterThan" Value="0" />
<!-- Block install if user does not have admin privileges -->
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
<!-- Block install on Win95 -->
<FailIf Property="Version9x" Compare="VersionLessThan" Value="4.10" String="InvalidPlatformWin9x"/>
<!-- Block install on NT 4 or less -->
<FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.00" String="InvalidPlatformWinNT"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="1641" Result="SuccessReboot"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
</ExitCodes>
</Command>
<Command PackageFile="AccessDatabaseEngine_x64.exe"
Arguments='/passive'>
<!-- These checks determine whether the package is to be installed -->
<InstallConditions>
<!-- ByPass if the Processor is not x64 -->
<BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="AMD64"/>
<!-- ByPass if we have installed -->
<BypassIf Property="IsInstalled" Compare="ValueGreaterThan" Value="0" />
<!-- Block install if user does not have admin privileges -->
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
<!-- Block install on Win95 -->
<FailIf Property="Version9x" Compare="VersionLessThan" Value="4.10" String="InvalidPlatformWin9x"/>
<!-- Block install on NT 4 or less -->
<FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.00" String="InvalidPlatformWinNT"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="1641" Result="SuccessReboot"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
</Product>
- Create a folder name en inside of MSAccessDBEng2010 folder.
- Create another XML file and name it package.xml inside of en folder. Write this code into this file.
<?xml version="1.0" encoding="utf-8" ?>
<Package
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
Name="DisplayName"
Culture="Culture"
LicenseAgreement="license.txt"
>
<PackageFiles>
<PackageFile Name="license.txt"/>
</PackageFiles>
<!-- Defines a localizable string table for error messages and url's -->
<Strings>
<String Name="DisplayName">Microsoft Access database engine 2010 (x86, x64)</String>
<String Name="Culture">en</String>
<String Name="DotNetFxRequired">Installation of Microsoft Access database engine 2010 requires Microsoft .NET Framework 2.0. Contact your application vendor.</String>
<String Name="InvalidPlatformWin9x">Installation of Microsoft Access database engine 2010 is not supported on Windows 95. Contact your application vendor.</String>
<String Name="InvalidPlatformWinNT">Installation of Microsoft Access database engine 2010 is not supported on Windows NT 4.0. Contact your application vendor.</String>
<String Name="GeneralFailure">A fatal error occurred during the installation of Microsoft Access database engine 2010.</String>
<String Name="AdminRequired">You do not have the permissions required to install this application. Please contact your administrator.</String>
</Strings>
</Package>
- Create a text file and name it license.txt file inside of en folder and write below line.
For detail please log on http://www.microsoft.com/en-us/download/details.aspx?id=13255
- Now copy MSAccessDBEng2010 into bootstrapper folder location.
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
- You can also determine the bootstrapper folder location from the Path value in the following registry key:
HKLM\Software\Microsoft\GenericBootstrapper\11.0
Now you can get that Package inside of Prerequisites in Visual Studio
Add Microsoft Access Database Engine 2010 as prerequisites in Setup project - C#
Reviewed by Bloggeur DZ
on
08:19
Rating:
This is really good article. I was searching for this from last 2 days. A big thanks to you. This is what exactly I wanted.
RĂ©pondreSupprimerThanks for this , can you please show us how to make the same for sql express 2016? I am searching the net for more than a week now and no answer :( your help is highly appreciated.
RĂ©pondreSupprimerThanks for this, I am trying to make own exe file and making package and product XML files, But it was not able to view in Prerequisites. Even i am trying to make your code too, But still it was not able to view in Prerequisites . Please can you help me to solve the issue.
RĂ©pondreSupprimerIs it possible to add only x64 version?
RĂ©pondreSupprimer