windows - 无法使用 PowerShell 安装 WebSphere setup.exe
问题描述
通过使用下面的代码,我可以从网上下载 zip 文件,然后将其解压缩到一个文件夹中,然后转到 Windows 文件夹 → setup.exe
。我可以双击setup.exe
但我无法进行静默安装或在安装界面上单击确定/下一步。
PowerShell代码:
if ($installationItem.FeatureName -match "WebSphere-Features") {
# if software directory not exists then create it
if (!(Test-Path $installationItem.FolderPath)) {
New-Item -ItemType Directory -Force -Path $installationItem.FolderPath | Out-Null
}
Write-Host "Downloading WebSphere... "
$client.DownloadFile($installationItem.Source, $installationItem.FilePath)
if (!(Test-Path $installationItem.FilePath)) {
Write-Host "Downloading $installationItem.FilePath failed"
return
}
Expand-Archive -Force -Path $installationItem.FilePath -DestinationPath $installationItem.FolderPath
# check if websphere already installed
if (Test-Path $installationItem.Test_Path) {
Write-Host 'Websphere Already Installed ..Skipping installtion of websphere.'
return
} else {
# Provide full access to the executable file to run
Unblock-File -Path $installationItem.FilePath1
# process installation
$proc1 = Start-Process -FilePath $installationItem.FilePath1 -ArgumentList "/s /v /qn REBOOT=ReallySuppress" -Wait -PassThru -Verb "RunAs"
$proc1.WaitForExit()
setting.xml
:
<?xml version="1.0"?>
<InstallationManagement>
<Installation Name="WebSphere" FeatureName="WebSphere-Features" Source="https://path/ibm_webshpere-1.zip" FolderPath="C:\softwares\websphere" FilePath="C:\softwares\ibm_webshpere-1.zip" FilePath1="C:\softwares\websphere\Windows\Setup.exe" Test_Path="C:\Program Files\webshpere"></Installation>
</InstallationManagement>
请帮助静默安装 websphere 或交互安装窗口的界面。
解决方案
推荐阅读
- android - 如何在不重新编译文件的情况下运行 ndk-build?
- c# - c# - 当签名相同时调用特定方法
- java - 使用 JNI 时如何修复“不是有效的 win32 应用程序”
- embedded - 为什么我们需要在UART通信中延迟读取字节?
- c# - 如何防止访问 SharePoint 上的 _VTI_BIN 文件夹并且我们正在使用内容搜索查询 Webpart?
- concordion - 如何使用junit记录进程md文件?
- php - 在 Add on Domain 中加载 WordPress 文件之外的 WordPress 函数
- flutter - 输入'未来
' 不是类型 '() => void' 的子类型 - django - 如何从forms.ModelForm中渲染表单集[模型使用ForeignKey连接到用户]
- php - Laravel 6:SQLSTATE[HY000]:一般错误:1215 无法添加外键约束