简体   繁体   English

Inno Setup在静默安装期间将锁定文件替换为下次重新启动

[英]Inno Setup Postpone locked file replacing to the next restart during silent installation

In Inno Setup installer (5.5.1(a)) during upgrade .exe is being replaced. 在Inno Setup安装程序(5.5.1(a))升级期间.exe正在被替换。 When the exe is locked, it is showing error 当exe被锁定时,它显示错误

DeleteFile failed; DeleteFile失败; code 5. 代码5。
Access is denied. 访问被拒绝。
Abort, Retry, Ignore 中止,重试,忽略

How to suppress message during silent upgrade please help me. 如何在静默升级期间抑制消息请帮助我。 By default during silent installation it should take Ignore option without any error. 默认情况下,在静默安装期间,应该选择Ignore选项而不会出现任何错

在此输入图像描述 .

I do not think it makes sense to ignore/skip the file. 我认为忽略/跳过文件是没有意义的。 I assume you need to replace it during upgrade, don't you? 我假设您需要在升级期间更换它,不是吗?


You can have a different entry for silent and non-silent installations: 您可以为静默和非静默安装使用不同的条目:

[Files]
Source: C:\path\MyProg.exe; Dest: {app}; Check: not WizardSilent
Source: C:\path\MyProg.exe; Dest: {app}; Flags: restartreplace; Check: WizardSilent

Most of the times it won't be able to replace your executable because that file is still running. 大多数情况下,它无法替换您的可执行文件,因为该文件仍在运行。 Why don't you just kill that process through BeforeInstall ?. 你为什么不通过BeforeInstall杀死那个进程?

Kill process before (re)install using "taskkill /f /im" in Inno Setup 使用Inno Setup中的“taskkill / f / im”在(重新)安装之前杀死进程

This approach won't help if your problem is because you have no rights to modify that file though. 如果您的问题是因为您无权修改该文件,则此方法无济于事。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM