【问题标题】:SQL Server setup.exe within a custom msi causes StackOverflowException自定义 msi 中的 SQL Server setup.exe 导致 StackOverflowException
【发布时间】:2011-11-01 03:03:52
【问题描述】:

我正在尝试创建一个还安装 SQL Server 的 .msi 安装程序(如果用户有磁盘/iso 文件)。

它的工作原理是:

  • 它运行一个批处理文件,批处理文件在它所在的驱动器中找到 setup.exe。
  • 批处理文件有 2 个参数,配置文件的位置和 msi 的安装目录
  • 然后它会搜索 setup.exe 并使用配置文件运行它,执行静默安装。

论据似乎与我运行它的方式完全相同。

@echo off
::this file searches for the setup.exe and then installs the server.
::ARGUMENTS:Complete Path to the Configuration File
 ::ATTENTION: this will need to search for a more unique file in the future!
 ::loop through each letter for a drive
 for %%A in (D E F G H I J K L M N O P Q R S T U V W X Y Z) Do ( 
::check if file exists, send any error messages to NUL, destroying it(e.g. no disk      in drive) and installif found
DIR  "%%A:/setup.exe" 1>NUL 2>&1 && call:install %%A %1 %2

::if we reach here the file ahsn't been found
if %%A == Z (
    @echo Please insert the Microsoft SQL Server 2008 R2 disk and try again.
    pause
    exit
)
)
 :install
net user grp-db ..grp.. /add
echo Installing SQL Server 2008 R2 with %~2 
date/t  
time /t
::"%~1:\setup.exe" /ConfigurationFile="%~2"
DIR "%~2"
date/t
time /t
pause
echo Creating ODBC data source.. with %~3
::"%~3"ODBCCONF.exe CONFIGSYSDSN "SQL Server" "DSN=GRP_DSN | Description=GRP Data         Source | SERVER=(local) | Trusted_Connection=Yes"
exit
goto:eof

从命令提示符运行批处理文件可以按预期完美运行,但在 msi 中会导致 StackOverflowException。检查 SQL 目录中的摘要文件说

用户取消了操作。异常类型:Microsoft.SqlServer.Chainer.Infrastructure.CancelException。

有没有人知道从哪里开始?

【问题讨论】:

    标签: visual-studio-2010 sql-server-2008 windows-installer stack-overflow


    【解决方案1】:

    SQL Server 安装与您的 MSI 进程之间似乎存在冲突。

    您可以尝试将其添加为 MSI 的先决条件,而不是使用 BAT 安装 SQL Server:

    【讨论】:

    • 是的,我想到了这一点,但我的计划是使用配置文件并让用户完全自动化,但现在你提到它,同时运行 2 个安装程序听起来会造成麻烦。
    猜你喜欢
    • 2019-11-11
    • 2015-08-24
    • 2013-12-20
    • 2016-12-16
    • 2021-02-09
    • 1970-01-01
    • 1970-01-01
    • 2022-07-03
    • 2016-07-07
    相关资源
    最近更新 更多