gpt4 book ai didi

NSIS - 静默自动更新应用程序

转载 作者:行者123 更新时间:2023-12-04 15:49:21 26 4
gpt4 key购买 nike

我的 .net c# 应用程序有一个 NSIS 安装工具包。

考虑到我已经将新更新(新 NSIS 应用程序版本)下载到本地计算机,有没有办法静默自动更新我的应用程序?

谢谢! :)

最佳答案

(如果您需要检测命令行/Autoupdate=yes)

!include FileFunc.nsh
!insertmacro GetParameters
!insertmacro GetOptions

Var CMD_ARGS
Var CMD_RES
Function .onInit
#
#installer stuff.
#
StrCpy $CMD_ARGS ""
StrCpy $CMD_RES "no"
${GetParameters} $CMD_ARGS
ClearErrors
${GetOptions} $CMD_ARGS /Autoupdate= $CMD_RES
StrCmp $CMD_RES "yes" is_update is_not_update
is_update:
#Execute all your update code(run your update app, etc)
MessageBox MB_OK|MB_ICONEXCLAMATION "IS UPDATE"
goto end_auto_update_check
is_not_update:
#Execute all your non-update code.
MessageBox MB_OK|MB_ICONEXCLAMATION "IS NOT UPDATE"
end_auto_update_check:
FunctionEnd

关于NSIS - 静默自动更新应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1361450/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com