简体   繁体   English

如何向电子生成器注册.dll

[英]How to register a .dll with electron-builder

In my project, there is an extra DLL file which is a direct show filter that needs to be registered to the system (windows). 在我的项目中,有一个额外的DLL文件,它是一个直接显示过滤器,需要注册到系统(Windows)。

I tried child_process.execSync but it requires admin privileges. 我尝试了child_process.execSync但它需要管理员权限。

Is it possible to program electron-builder to register a .dll file after installation? 安装后是否可以对electron-builder进行编程以注册.dll文件?

With electron-builder You can use a custom NSIS script as shown here . 随着electron-builder可以使用自定义脚本NSIS如图所示这里

You can use it to register your dll using the installer like this: 您可以使用安装程序使用它来注册您的dll,如下所示:

!macro customInstall

  ; Register your DLL
  Exec "regsvr32 /s $INSTDIR\path-to\your.dll"

!macroend

!macro customUnInit

 ; Unregister your DLL
  Exec "regsvr32 /s /u $INSTDIR\path-to\your.dll"

!macroend

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

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