简体   繁体   English

如何在未安装Office 2010的计算机上安装带有MS Access数据库的Visual Studio 2010安装项目?

[英]How to install visual studio 2010 setup project with MS Access database on a computer which is not having Office 2010 installed?

I am developing wpf application in C#. 我正在用C#开发wpf应用程序。 I have successfully created the setup project for wpf application in visual studio 2010. I have used MS Access 2010 as a database. 我已经在visual studio 2010中成功创建了wpf应用程序的安装项目。我使用MS Access 2010作为数据库。 It install fine on all computers. 它安装在所有计算机上。 But on some computer there is no Microsoft Office installed and on some computer there is lower version of MS Office like MS Office 2003. When I install my application on these computers it gives me connectivity issues. 但在某些计算机上没有安装Microsoft Office,在某些计算机上有MS Office的较低版本,如MS Office 2003.当我在这些计算机上安装我的应用程序时,它会给我带来连接问题。 Can you please tell me what should I need to do ? 你能告诉我我该怎么办? Should I need to include any prerequisite for MS Access 2010 in visual studio 2010 setup project ? 我是否需要在Visual Studio 2010安装项目中包含MS Access 2010的任何先决条件? If there is any which are they and how to include them ? 如果有什么是它们以及如何包含它们?

I had same problem but I have already created a Bootstrapper package for Microsoft Access Database Engine 2010. I've also included in this package x64 version of it. 我有同样的问题,但我已经为Microsoft Access数据库引擎2010创建了一个Bootstrapper包。我还包含在这个包x64版本中。 So it should work on 64 machine also. 所以它应该也适用于64机器。 To include any Prerequisites you must have to add a Bootstrapper Package of that. 要包含任何先决条件,您必须添加它的Bootstrapper包。 After that you can get that in your Prerequisite list. 之后,您可以在先决条件列表中获取该内容。 That already you know I think. 我想你已经知道了。 To build a Bootstrapper you need 2 manifest XML files. 要构建Bootstrapper,您需要2个清单XML文件。 1 is product.xml and another is package.xml right? 1是product.xml,另一个是package.xml对吗? I'm writing all the XML script below. 我正在编写下面的所有XML脚本。

PRODUCT XML: 产品XML:

<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>

PACKAGE XML: 包装XML:

<?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>

license.txt LICENSE.TXT

For detail please Log on http://www.microsoft.com/en-us/download/details.aspx?id=13255

Note: I've already tested in my Windows 7 x86 Machine and it works perfect. 注意:我已经在我的Windows 7 x86机器上进行了测试,它完美无缺。 It doesn't reinstall if already installed. 如果已安装,则不会重新安装。 I've no x64 machine so I don't know the Product code of it. 我没有x64机器,所以我不知道它的产品代码。 But I'm sure it'll work too. 但我相信它也会奏效。 It also downloads this package from website and I've tested that. 它也从网站上下载这个包,我已经测试过了。

If you need any further help or complete Bootstrapper Package just let me know. 如果您需要任何进一步的帮助或完成Bootstrapper Package,请告诉我。

Cheers. 干杯。

You migth be able to use Microsoft Access Database Engine 2010 Redistributable 您可以使用Microsoft Access数据库引擎2010可再发行组件

-- Update -- - 更新 -
To add custom prerequisites you need to create a Bootstrapper Package here are some instructions: Creating Bootstrapper Packages 要添加自定义先决条件,您需要创建一个Bootstrapper包,这里有一些说明: 创建Bootstrapper包
Deploying Custom made Visual Studio prerequisites using Bootstrapper Manifest Generator 使用Bootstrapper Manifest Generator部署自定义Visual Studio先决条件

-- Update 2 -- - 更新2 -
For 64-bit implementations see comment from Massood Khaari below. 对于64位实现,请参阅下面的Massood Khaari的评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2010 中的设置项目有问题? - Having problem with setup project in visual studio 2010? MS Visual Studio 2010数据库与MS Access 2007的连接 - MS Visual Studio 2010 Database connection to MS Access 2007 在Visual Studio 2012中为Office 2010构建VSTO项目时,出现“未安装Project Target Framework”错误 - “Project Target Framework Not installed” error comes when building the VSTO project for Office 2010 in Visual studio 2012 Visual Studio 2010安装项目本地化 - Visual studio 2010 setup project localization Visual Studio 2010安装项目问题 - Visual Studio 2010 setup project issue 在visual studio 2010中添加设置项目的快捷方式 - Adding shortcut to setup project in visual studio 2010 Visual Studio 2010安装程序项目设置 - Visual Studio 2010 Setup Project Settings 如何在Visual Studio 2010中使用我的设置和部署项目部署SQL Server数据库? - How can I deploy the SQL server database with my setup and deployment project in Visual Studio 2010? 在Visual Studio Express 2010中设置项目Templete不可用..那么该怎么办 - setup project templete in visual studio express 2010 unavailable ..then how to do 如何在Visual Studio 2010中设置winforms项目的起始形式 - How to setup the starting form of a winforms project in Visual Studio 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM