自定义安装过程当中遇到的不能找到installstate文件问题

解决安装程序中自定义操作错误
本文解决了在安装程序的Commit阶段运行自定义操作时出现的问题,即找不到安装状态文件。通过将自定义操作同时添加到安装和提交阶段,即使在安装阶段不执行任何操作也能创建所需的文件。
Custom action within installer - Could not find MyAction.Installstate

I wanted to run custom action code during the Commit phase of the Setup Project.

I created an installer class and override the Commit method. I also added that installer as a custom action to the Commit phase (View->Custom Actions).

During the installation process I got an exception saying “Could not find C:/Program Files/MyApp/MyAction.Installstate”

The problem is that the MSI infrastructure  is looking for the installation state file which is usually created during the Install phase. If the custom action does not participate in the Install phase, no file is created.

The solution is to add the custom action to both the Install and the Commit phases, although it does nothing during the install phase.

 
正在运行事务处理安装。 正在开始安装的“安装”阶段。 查看日志文件的内容以获得 D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.exe 程序集的进度。 该文件位于 D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.InstallLog。 正在安装程序集“D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.exe”。 受影响的参数是: logtoconsole = logfile = D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.InstallLog assemblypath = D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.exe 没有 RunInstallerAttribute.Yes 的公共安装程序。在 D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.exe 程序集中应该可以找到“Yes”特性。 “安装”阶段已成功完成,正在开始“提交”阶段。 查看日志文件的内容以获得 D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.exe 程序集的进度。 该文件位于 D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.InstallLog。 正在提交程序集“D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.exe”。 受影响的参数是: logtoconsole = logfile = D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.InstallLog assemblypath = D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.exe 没有 RunInstallerAttribute.Yes 的公共安装程序。在 D:\gao_chengjie\xiaoniuResultCheck\xiaoniuResultCheck\bin\Debug\XiaoNiuResultForMES.exe 程序集中应该可以找到“Yes”特性。 没有安装程序,因此移除 InstallState 文件。 “提交”阶段已成功完成。 已完成事务处理安装
最新发布
09-12
<think>我们正在处理一个关于在Windows Server2022上安装PowerBuilder12.6后无法启动的问题。根据引用[2],有一个已知问题:在Win10下,PowerBuilder12.5和12.6可能会卡在欢迎界面,解决方法是停止服务“TouchKeyboardandHandwritingPanelService”。 虽然用户的环境是Windows Server2022,但这个问题可能类似,因为Windows Server2022和Windows10共享相同的核心。因此,我们可以建议用户尝试停止这个服务,然后再次启动PowerBuilder。此外,我们还需要考虑其他可能的因素:1.兼容性设置:尝试以兼容模式运行PowerBuilder(例如,Windows7或Windows8)。 2.管理员权限:确保使用管理员权限运行PowerBuilder。3.安装过程中的问题:确保安装过程正确,没有中断,并且安装的是与系统兼容的版本。但是,根据引用[2]提供的信息,最直接的尝试是停止“TouchKeyboardandHandwritingPanelService”服务。步骤:1.打开“服务”管理控制台(可以通过运行services.msc或通过服务器管理器打开)。 2.在服务列表中找到“Touch Keyboardand Handwriting PanelService”(服务名称可能为“TabletInputService”或类似,具体名称可能因系统版本而异,但描述应该是关于触摸键盘和手写面板的)。3.停止该服务(右键单击,选择“停止”)。 4.尝试启动PowerBuilder12.6。 如果问题解决,为了避免每次手动停止,可以设置该服务为“禁用”(但注意,这可能会影响触摸键盘和手写功能,在服务器上通常不需要)。 如果上述方法无效,我们再考虑其他方法。另外,引用[1]中提到安装过程中进入安全模式以避免冲突,但用户已经安装完成,所以这一点可能不适用。但如果在安装过程中存在问题,可能需要重新安装(在安全模式下安装)。引用[3]和[4]是关于数据库连接和三层架构的,与启动问题无关。因此,我们首先建议用户尝试停止上述服务。如果用户的问题仍然存在,我们可以进一步探索:-检查事件查看器中的应用程序日志,看是否有相关错误。-确保系统满足PowerBuilder12.6的系统要求(例如,.NET Framework版本等)。 -尝试重新安装PowerBuilder,并在安装时关闭所有不必要的程序。由于用户是在Windows Server2022上,这是一个较新的服务器操作系统,可能还需要考虑PowerBuilder12.6是否官方支持该操作系统。如果不支持,可能需要使用兼容模式或更新到更高版本的PowerBuilder(如果可用)。 但是,根据引用[2]的解决方案,我们优先尝试停止服务的方法。</think>### PowerBuilder 12.6 在 Windows Server 2022 启动问题解决方案 根据引用[2]中提到的Win10启动问题和解决方案[^2],结合Windows Server 2022环境特性,请按以下步骤操作: #### 核心解决方法 1. **停止冲突服务** ```powershell Stop-Service -Name "TabletInputService" -Force ``` - 这是引用[2]中"TouchKeyboardandHandwritingPanelService"服务的升级版名称 - 该服务在服务器环境中通常无用,可直接禁用: ```powershell Set-Service -Name "TabletInputService" -StartupType Disabled ``` 2. **兼容性设置**(针对新版OS): - 右键点击PB12.6快捷方式 → 属性 → 兼容性 - 勾选: ```markdown ☑ 以管理员身份运行此程序 ☑ 禁用全屏优化 ☑ 覆盖高DPI缩放行为(由应用程序执行) ``` #### 补充排查步骤 3. **权限修复**: ```powershell icacls "C:\Program Files (x86)\Sybase\PowerBuilder 12.6" /grant "IIS_IUSRS:(OI)(CI)F" /T ``` 4. **关键配置文件检查**: - 验证注册表路径: `HKEY_CURRENT_USER\Software\Sybase\PowerBuilder\12.6` - 检查环境变量: ```powershell Get-ChildItem Env: | Where-Object {$_.Name -like "*PB*"} ``` 5. **日志分析**: - 查看事件日志: ```powershell Get-WinEvent -LogName Application -MaxEvents 50 | Where-Object {$_.Message -like "*PowerBuilder*"} ``` #### 预防性措施 - **安装注意事项**(引用[1]建议[^1]): - 安装时关闭防病毒软件 - 确保安装包完整性(验证SHA256) - 服务器环境建议使用最小化安装组件 > **重要提示**:若仍无法启动,需检查系统组件: > ```powershell > Get-WindowsFeature *Framework* | Where-Object {$_.InstallState -eq "Installed"} > ``` > PowerBuilder 12.6 需要 .NET Framework 3.5 支持,在Server 2022中需手动启用。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值