简体   繁体   中英

NSIS register DLL with regsvr32

I'm trying to register DLL with regsvr32 in nsis installer (no silent at the moment):

Exec '"$SYSDIR\regsvr32.exe" "$SYSDIR\mp4mux.dll"'
Exec '"$SYSDIR_32bit\regsvr32.exe" "$SYSDIR_32bit\mp4mux.dll"'

It shows pop-up that DLL was registered (both 32- and 64-bit) and in install logs it shows next line:

Execute: "C:\WINDOWS\system32\regsvr32.exe" "C:\WINDOWS\system32\mp4mux.dll"
//for 32-bit is similar

However, when I'm trying to use it, it doesn't work (I'm trying to create mp4 video with x264 codec, so it just shows an error). If I copy this command into command line, same pop-up is shown and video is being created.

What could go wrong with this flow? I tried also RegDLL and rundll32 without success.

UPDATE:

I can't find my DLL registered in Registry for x64, only x32. Record for C:\\WINDOWS\\System32\\mp4mux.dll doesn't exist, only for dll in SysWow64

Filesystem redirection will redirect a 32-bit application from System32 ( $SysDir ) to SysWow64 on 64-bit Windows.

You can

  • Disable redirection for a short time with the ${DisableX64FSRedirection} macro from x64.nsh
  • Execute $WinDir\\Sysnative\\regsvr32.exe instead on 64-bit Vista and later

but why go through the trouble when you can just use the library macros:

!include Library.nsh
!define LIBRARY_X64
!insertmacro InstallLib REGDLL NOTSHARED REBOOT_NOTPROTECTED c:\myfiles\64\dllname.dll $SYSDIR\dllname.dll $SYSDIR

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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