杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1828|回复: 0

NSIS驱动安装插件脚本

[复制链接]
发表于 2019-3-1 21:55:06 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. !AddPluginDir .
  2. Name "InstDrv.dll test"
  3. OutFile "InstDrv-Test.exe"
  4. ShowInstDetails show
  5. ComponentText "InstDrv Plugin Usage Example"
  6. Page components
  7. Page instfiles
  8. Section "Install a Driver" InstDriver
  9. InstDrv::InitDriverSetup /NOUNLOAD "{4d36e978-e325-11ce-bfc1-08002be10318}" "IrCOMM2k"
  10. Pop $0
  11. DetailPrint "InitDriverSetup: $0"
  12. InstDrv::DeleteOemInfFiles /NOUNLOAD
  13. Pop $0
  14. DetailPrint "DeleteOemInfFiles: $0"
  15. StrCmp $0 "00000000" PrintInfNames ContInst1
  16. PrintInfNames:
  17. Pop $0
  18. DetailPrint "Deleted $0"
  19. Pop $0
  20. DetailPrint "Deleted $0"
  21. ContInst1:
  22. InstDrv::CreateDevice /NOUNLOAD
  23. Pop $0
  24. DetailPrint "CreateDevice: $0"
  25. SetOutPath $TEMP
  26. File "ircomm2k.inf"
  27. File "ircomm2k.sys"
  28. InstDrv::InstallDriver /NOUNLOAD "$TEMPircomm2k.inf"
  29. Pop $0
  30. DetailPrint "InstallDriver: $0"
  31. StrCmp $0 "00000000" PrintReboot ContInst2
  32. PrintReboot:
  33. Pop $0
  34. DetailPrint "Reboot: $0"
  35. ContInst2:
  36. InstDrv::CountDevices
  37. Pop $0
  38. DetailPrint "CountDevices: $0"
  39. SectionEnd
  40. Section "Uninstall the driver again" UninstDriver
  41. InstDrv::InitDriverSetup /NOUNLOAD "{4d36e978-e325-11ce-bfc1-08002be10318}" "IrCOMM2k"
  42. Pop $0
  43. DetailPrint "InitDriverSetup: $0"
  44. InstDrv::DeleteOemInfFiles /NOUNLOAD
  45. Pop $0
  46. DetailPrint "DeleteOemInfFiles: $0"
  47. StrCmp $0 "00000000" PrintInfNames ContUninst1
  48. PrintInfNames:
  49. Pop $0
  50. DetailPrint "Deleted $0"
  51. Pop $0
  52. DetailPrint "Deleted $0"
  53. ContUninst1:
  54. InstDrv::RemoveAllDevices
  55. Pop $0
  56. DetailPrint "RemoveAllDevices: $0"
  57. StrCmp $0 "00000000" PrintReboot ContUninst2
  58. PrintReboot:
  59. Pop $0
  60. DetailPrint "Reboot: $0"
  61. ContUninst2:
  62. Delete "$SYSDIRsystem32ircomm2k.sys"
  63. SectionEnd
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-18 01:55 , Processed in 0.111739 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表