Old 4th May 2020, 02:41   #1
Fenrirthviti
Junior Member
 
Join Date: May 2020
Posts: 2
InstallLib - Pass Flags

Hello! After several hours of searching, googling, experimenting, etc. I have come to here as a last resort. I'm building an installer that registers a .dll file, but this .dll has a flag that can be passed to change the end result when it is registered. I cannot find any way to pass this flag using InstallLib. It appears to be possible using Exec, but all the documentation and all the guides/wiki/forum posts/stackoverflow/etc. etc. all say that we should not be using Exec anymore, and InstallLib is "more versatile and has more flexibility". I am not finding this to be the case, as I don't seem to have control over the flags being sent.

As an example of what I need to be able to do:

code:
regsvr32 /n /i:"2" "c:\temp\my.dll"


Is there a way to do this using InstallLib, or should I just use Exec instead?
Fenrirthviti is offline   Reply With Quote
Old 4th May 2020, 10:31   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,294
It does look like that is not supported.

Use regsvr32 or System::Call.

Quote:
System::Call '"$InstDir\mylib.dll"::DllInstall(i 1, w "2")i.r0 ?u' ; result in $0
System::Call only works if the .dll is the same bitness as the installer.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th May 2020, 20:41   #3
Fenrirthviti
Junior Member
 
Join Date: May 2020
Posts: 2
Thanks for the quick response. I have a 32 and 64bit dll that need to be registered, so looks like I'm using regsvr32 with exec.

Thanks again!
Fenrirthviti is offline   Reply With Quote
Old 2nd July 2020, 02:19   #4
sandeep_111
Junior Member
 
Join Date: Jul 2020
Posts: 2
64 bit dll calling in NSIS script using system call

Hello, I am using following command to call 64 bit dll and read the parameters from that.
I am able to call 32 bit dll successfully but unable to call 64-bit dll .

System::Call '"C:\Program Files\Temp\Utilities.dll":etectRunningProcess(t) h("SeqEdit.exe" r6) .r7'
sandeep_111 is offline   Reply With Quote
Old 2nd July 2020, 10:17   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,294
You can't load a 64-bit dll in a 32-bit process, you need a little helper exe.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 2nd July 2020, 19:39   #6
sandeep_111
Junior Member
 
Join Date: Jul 2020
Posts: 2
Thanks for quick reply.
That means it won't possible with NSIS v3.05 . is there exe available to support 64 bit dll from NSIS?
sandeep_111 is offline   Reply With Quote
Old 2nd July 2020, 21:28   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,294
I believe the Locked List plug-in can detect 64-bit processes.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump