Ejemplo n.º 1
0
function IEInstall()
{
    $install = $_REQUEST['install'];
    $code = '{3F218DFB-00FF-297C-4D54-57696C4A6F6F}';
    $title = 'SiteBar';
    $url = SB_Page::absBaseUrl() . 'index.php';
    $reg = '';
    $filename = '';
    $ctxUrl = SB_Page::absBaseUrl() . 'ctxmenu.php';
    require_once './inc/converter.inc.php';
    $charsetKey = 'Charset in MS Windows';
    $c = new SB_Converter(!$um || $um->getParam('config', 'use_conv_engine'), SB_T($charsetKey) == $charsetKey ? null : SB_T($charsetKey));
    $addLink = $c->fromUTF8(SB_T('Add Link to SiteBar'));
    $addPage = $c->fromUTF8(SB_T('Add Page to SiteBar'));
    if ($install) {
        $filename = "InstallSiteBar.reg";
        // See http://msdn.microsoft.com/workshop/browser/ext/tutorials/explorer.asp
        $reg = <<<__INSTALL
REGEDIT4

[HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{$code}]
@="{$title}"

[HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{$code}\\Implemented Categories]

[HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{$code}\\Implemented Categories\\{00021493-0000-0000-C000-000000000046}]

[HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{$code}\\InProcServer32]
@="shdocvw.dll"
"ThreadingModel"="Apartment"

[HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{$code}\\Instance]
"CLSID"="{4D5C8C2A-D075-11d0-B416-00C04FB90376}"

[HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{$code}\\Instance\\InitPropertyBag]
"Url"="{$url}"

[-HKEY_CURRENT_USER\\Software\\Classes\\Component Categories\\{00021493-0000-0000-C000-000000000046}\\Enum]

[-HKEY_CURRENT_USER\\Software\\Classes\\Component Categories\\{00021494-0000-0000-C000-000000000046}\\Enum]

[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\{$addLink}]
"Contexts"=hex:22
"Flags"=hex:01
@="{$ctxUrl}?add=link"

[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\{$addPage}]
"Contexts"=hex:01
"Flags"=hex:01
@="{$ctxUrl}?add=page"

[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Internet Explorer\\Explorer Bars\\{$code}]
"BarSize"=hex:B4
"Name"="{$title}"

[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Internet Explorer\\Extensions\\{23F5C49C-74DF-42BA-A194-FF92A3B59FED}]
"ButtonText" = "SiteBar"
"MenuText" = "SiteBar Panel"
"MenuStatusBar"="Display SiteBar Panel"
"Icon" = hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,73,68,65,6c,6c,33,32,2e,64,6c,6c,2c,31,37,33,00
"HotIcon" = hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,73,68,65,6c,6c,33,32,2e,64,6c,6c,2c,31,37,33,00
"CLSID" = "{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}"
"BandCLSID" = "{$code}"
"Default Visible"="Yes"
__INSTALL;
    } else {
        $filename = 'UnInstallSiteBar.reg';
        $reg = <<<__UNINSTALL
REGEDIT4

[-HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{$code}]
[-HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Internet Explorer\\Explorer Bars\\{$code}]
[-HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Internet Explorer\\Extensions\\{23F5C49C-74DF-42BA-A194-FF92A3B59FED}]
[-HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\Add Link to SiteBar]
[-HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\Add Page to SiteBar]
[-HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\{$addLink}]
[-HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\{$addPage}]
__UNINSTALL;
    }
    header('Content-Type: application/octet-stream' . "\r");
    header('Content-Disposition: attachment; filename="' . $filename . "\"\r");
    header('Content-Transfer-Encoding: binary' . "\r");
    header('Content-Length: ' . strlen($reg) . "\r");
    echo $reg;
    exit;
}