无忧启动论坛

标题: EdgeWebView2 在线下载安装 NSIS脚本 [打印本页]

作者: cls822001    时间: 3 小时前
标题: EdgeWebView2 在线下载安装 NSIS脚本
EdgeWebView2 在线下载安装 NSIS脚本 自行编译
  1. Name "${PRODUCT_NAME}"

  2.   !define PRODUCT_NAME "EdgeWebView2"

  3. OutFile "${PRODUCT_NAME}在线下载安装.exe"
  4.   !include "MUI2.nsh"
  5.   !include "x64.nsh"
  6.   !define MUI_PAGE_CUSTOMFUNCTION_PRE 'CopyFiles'
  7.   !define MUI_PAGE_CUSTOMFUNCTION_SHOW MyInstFiles
  8.   !insertmacro MUI_PAGE_INSTFILES
  9.   !insertmacro MUI_LANGUAGE "SimpChinese"

  10.   VIProductVersion "1.0.0.0" ;版本号
  11.   VIAddVersionKey /LANG=2052 "ProductName" "顺艺${PRODUCT_NAME}部署程序" ;文件描述
  12.   VIAddVersionKey /LANG=2052 "Comments" "顺艺科技"   ;备注
  13.   VIAddVersionKey /LANG=2052 "CompanyName" "www.jywangluo.cn"
  14.   VIAddVersionKey /LANG=2052 "LegalCopyright" "版权所有 (C)  顺艺科技"  ;版权
  15.   VIAddVersionKey /LANG=2052 "FileDescription" "顺艺${PRODUCT_NAME}部署程序" ;产品名称
  16.   VIAddVersionKey /LANG=2052 "FileVersion" "1.0.0.0"  ;文件版本
  17.   VIAddVersionKey /LANG=2052  "ProductVersion" "1.0.0.0" ;产品版本
  18.   VIAddVersionKey /LANG=2052 "OriginalFilename" "${PRODUCT_NAME}setup.exe" ;源文件名

  19. Icon ${PRODUCT_NAME}.ico
  20. ShowInstDetails nevershow
  21. AutoCloseWindow true
  22. BrandingText "东莞顺艺网络专用"
  23. Caption "东莞顺艺网络"

  24. Section "update" update
  25.         SetDetailsPrint textonly
  26.         DetailPrint "正在下载${PRODUCT_NAME}最新文件请稍后...."
  27.         setDetailsPrint listonly
  28.         ${If} ${RunningX64}
  29.   NScurl::http GET "http://go.microsoft.com/fwlink/?LinkID=2124701" "$PLUGINSDIR\MicrosoftEdgeWebView2Runtime.exe"
  30.   ${Else}
  31.   NScurl::http GET "http://go.microsoft.com/fwlink/?LinkID=2099617" "$PLUGINSDIR\MicrosoftEdgeWebView2Runtime.exe"
  32.   ${EndIf}
  33.         SetDetailsPrint textonly
  34.         DetailPrint "正在安装${PRODUCT_NAME}最新文件请稍后...."
  35.         setDetailsPrint listonly
  36.         Execwait "$PLUGINSDIR\MicrosoftEdgeWebView2Runtime.exe /silent /install"
  37.         SetDetailsPrint textonly
  38.         DetailPrint "正在优化${PRODUCT_NAME}请稍后...."
  39.         setDetailsPrint listonly
  40.   ReadRegStr $R0 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate" "edgeupdate_task_name_c"
  41.   ReadRegStr $R1 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate" "edgeupdate_task_name_ua"
  42.   nsExec::Exec 'schtasks.exe /Delete /TN \$R0 /F'
  43.   nsExec::Exec 'schtasks.exe /Delete /TN \$R1 /F'
  44.   nsExec::Exec 'taskkill /im MicrosoftEdgeUpdate.exe /f '
  45.   nsExec::Exec 'taskkill /im msedge.exe /f '
  46.   nsExec::Exec 'sc.exe delete "edgeupdate"'
  47.   nsExec::Exec 'sc.exe delete "edgeupdatem"'
  48.   nsExec::Exec 'sc.exe delete "MicrosoftEdgeElevationService"'
  49.         RMDir /r "$PROGRAMFILES\Microsoft\EdgeUpdate"
  50. SectionEnd


  51. Function MyInstFiles
  52.    GetDlgItem $0 $HWNDPARENT 1 ;下一步
  53.    ShowWindow $0 ${SW_HIDE}
  54.    GetDlgItem $0 $HWNDPARENT 2 ;取消
  55.    ShowWindow $0 ${SW_HIDE}
  56.    GetDlgItem $1 $HWNDPARENT 3 ;上一步
  57.    ShowWindow $1 ${SW_HIDE}
  58.    GetDlgItem $0 $HWNDPARENT 1037
  59.    SendMessage $0 ${WM_SETTEXT} 0 "STR: "
  60.    GetDlgItem $0 $HWNDPARENT 1038
  61.    SendMessage $0 ${WM_SETTEXT} 0 "STR:东莞顺艺网络更新程序正在下载最新文件,请稍候...."
  62. FunctionEnd

  63. Function 'CopyFiles'
  64. GetDlgItem $R0 $HWNDPARENT 1
  65. System::Call 'user32::GetWindowLong(i $hwndparent,i -16)i.r0'
  66.   intop $1 0x80000 ~
  67.   intop $0 $0 & $1
  68. System::Call 'user32::SetWindowLong(i $hwndparent,i -16,i $0)i'
  69. FunctionEnd
复制代码



作者: 13979895485    时间: 3 小时前
EdgeWebView2 在线下载安装 NSIS脚本,谢谢分享!
作者: ebaqiang    时间: 3 小时前
谢谢分享!
作者: 心雨飞飞    时间: 3 小时前
另存为啥格式?
作者: wn168cn@163.com    时间: 2 小时前
支持原创
作者: cls822001    时间: 2 小时前
心雨飞飞 发表于 2025-11-22 11:49
另存为啥格式?

nsis脚本 用nsis编译成exe

作者: 2011monoso    时间: 2 小时前
制作离线安装包吗
作者: ruanfen    时间: 2 小时前
感谢分享, 学习收藏了
作者: guong    时间: 1 小时前
谢谢分享了!
作者: slc1234    时间: 1 小时前
感谢分享!!!
作者: 左岸麦田    时间: 1 小时前
感谢楼主分享
作者: xiaozgl119    时间: 半小时前
感谢分享
作者: a66    时间: 15 分钟前
了解
作者: PCHH    时间: 5 分钟前
感谢分享




欢迎光临 无忧启动论坛 (http://bbs.c3.wuyou.net/) Powered by Discuz! X3.3