Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Registering Dll's Through script file


1 reply to this topic

rdrouill

rdrouill
  • Members
  • 1 posts

Posted 13 June 2002 - 18:06

I have a question to see if there is a better way to perform a function.  my installation is registering a dll that it is not placing on the system itself as it already is there.  I have been using a way to register the dll with using LaunchAppAndWait and calling Regsvr32.exe My problem is that either you supress the successes or failures with /s or you have the come up every time which is very annoying and won't work.  But if you supress the message you don't know if the DLL failed.  I tried to trap for that with any luck.  Any better method of registering a dll is greatly appreciated.  Listed below is the code.

if (LaunchAppAndWait ( SystemFolder ^ "REGSVR32.EXE ", "\"" + SystemFolder ^ "mydll.dll" + "\"" + " /s" , WAIT )<0) then      
    MessageBox("mydll.dll failed", INFORMATION);

shankx

shankx
  • Full Members
  • 5 posts

Posted 07 September 2006 - 13:51

Use
if (XCopyFile ( szSrcFile, szTargetPath, SELFREGISTER|SHAREDFILE ) < 0 ) then
// error msg
endif;

You can obtain the error message text associated with a large negative return value—for example, -2147024891 (0x80070005)—by calling FormatMessage.