Shoutbox

[Question] Registering ocx components - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Question] Registering ocx components (/showthread.php?tid=70931)

[Question] Registering ocx components by tryxter on 01-22-2007 at 01:20 PM

How is this done? I know I must use regsrv32, but how can I run DOS commands on a script?
The objective is to register the ocx component while loading the script, so it can be accessible by the script.

Thanks


RE: [Question] Registering ocx components by Felu on 01-22-2007 at 01:31 PM

code:
var Shell = new ActiveXObject("WScript.Shell");
Shell.Run("regsrv32 /s:"+MsgPlus.ScriptFilesPath+"\\file.ocx");

or you could even place it under OleFiles in the scriptinfo.xml
RE: [Question] Registering ocx components by tryxter on 01-22-2007 at 01:51 PM

quote:
Originally posted by Felu
code:
var Shell = new ActiveXObject("WScript.Shell");
Shell.Run("regsrv32 /s:"+MsgPlus.ScriptFilesPath+"\\file.ocx");

or you could even place it under OleFiles in the scriptinfo.xml

Thanks a lot! :)
Using this method (WScript.Shell) it will be ready to be accessed by MsgPlus?
RE: [Question] Registering ocx components by vikke on 01-22-2007 at 01:54 PM

When you create a script-install program, you can choose which DLL's to register. But if you want to do it in a script, use Felu's code :).

To answer your question:
Maybe. I actually think this would require a computer restart, that's the reason why you have to restart your computer after installing programs (there's other reasons as well).


RE: [Question] Registering ocx components by tryxter on 01-22-2007 at 02:49 PM

quote:
Originally posted by vikke
When you create a script-install program, you can choose which DLL's to register. But if you want to do it in a script, use Felu's code :).

To answer your question:
Maybe. I actually think this would require a computer restart, that's the reason why you have to restart your computer after installing programs (there's other reasons as well).

And if I use OleFiles it won't need a computer restart?
RE: [Question] Registering ocx components by Felu on 01-22-2007 at 02:54 PM

quote:
Originally posted by tryxter
Using this method (WScript.Shell) it will be ready to be accessed by MsgPlus?


Yea. Its the same as registering through the command line. You can use Shell.Run as many time as you want but placing it in OleFiles will only register it while the script is imported.
RE: RE: [Question] Registering ocx components by tryxter on 01-22-2007 at 03:00 PM

quote:
Originally posted by Felu
quote:
Originally posted by tryxter
Using this method (WScript.Shell) it will be ready to be accessed by MsgPlus?


Yea. Its the same as registering through the command line. You can use Shell.Run as many time as you want but placing it in OleFiles will only register it while the script is imported.


Ok,
and one more time, thanks a lot! :)
RE: [Question] Registering ocx components by vikke on 01-22-2007 at 04:57 PM

Yes, it's possible. If you put the OCX in the Windows folder, a reboot is a must to register it automatically! :)