function OnEnd()
string szDLL, szReg, szCmd;
begin
szReg = WINSYSDIR ^ "regsvr32.exe";
szDLL = TARGETDIR ^ "MYDLL.dll"; //如果是MSI工程,可以用INSTALLDIR代替TARGETDIR
szCmd = "/s \"" + szDLL + "\""; //增加静默参数s, 增加 \” 防止目录路径含空格的情况。
if (!REMOVEONLY) then
LaunchAppAndWait(szReg, szCmd, WAIT);
endif;
end;