fixing bug 28172 - Add shortcut to launch bar. r=sgehani, sr=mscott

This commit is contained in:
ssu%netscape.com 2001-11-03 00:34:17 +00:00
Родитель 49afd8dfa4
Коммит 691796d9ef
3 изменённых файлов: 59 добавлений и 6 удалений

Просмотреть файл

@ -37,6 +37,7 @@ function createShortcuts()
var szFolderDesktop;
var szFolderQuickLaunch;
var szFolderSendTo;
var szFolderAppData;
var szStartupFolder;
var winreg;
var fWindows;
@ -50,8 +51,10 @@ function createShortcuts()
var fFolderDesktop;
var fFolderPath;
var fFolderPathStr;
var fFolderQuickLaunch;
var is_winnt;
var szCurrentVersion;
var folderQuickLaunchExists;
winreg = getWinRegistry();
fWindows = getFolder("Windows");
@ -112,9 +115,24 @@ function createShortcuts()
valname = "SendTo";
szFolderSendTo = winreg.getValueString(subkey, valname);
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups";
valname = "Quick Launch";
szFolderQuickLaunch = winreg.getValueString(subkey, valname);
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
valname = "AppData";
szFolderAppData = winreg.getValueString(subkey, valname);
// locate the Quick Launch folder
szFolderQuickLaunch = szFolderAppData + "\\Microsoft\\Internet Explorer\\Quick Launch";
fFolderQuickLaunch = getFolder("file:///", szFolderQuickLaunch);
folderQuickLaunchExists = File.exists(fFolderQuickLaunch);
if(!folderQuickLaunchExists)
{
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups";
valname = "Quick Launch";
szFolderQuickLaunch = winreg.getValueString(subkey, valname);
folderQuickLaunchExists = File.exists(fFolderPath);
if(folderQuickLaunchExists)
fFolderQuickLaunch = getFolder("file:///", szFolderQuickLaunch);
}
logComment("folderQuickLaunchExists: " + folderQuickLaunchExists);
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main";
valname = "Program Folder Path";
@ -152,6 +170,10 @@ function createShortcuts()
File.windowsShortcut(fileExe, fFolderPath, scExeDesc, fProgram, "", fileExe, 0);
File.windowsShortcut(fileExe, fFolderPath, scProfileDesc, fProgram, scProfileDescParam, fileExe, 0);
// create shortcut in the Quick Launch folder
if(folderQuickLaunchExists)
File.windowsShortcut(fileExe, fFolderQuickLaunch, scExeDesc, fProgram, "", fileExe, 0);
if(!restrictedAccess)
{
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);

Просмотреть файл

@ -37,6 +37,7 @@ function createShortcuts()
var szFolderDesktop;
var szFolderQuickLaunch;
var szFolderSendTo;
var szFolderAppData;
var winreg;
var fWindows;
var fTemp;
@ -49,10 +50,12 @@ function createShortcuts()
var fFolderDesktop;
var fFolderPath;
var fFolderPathStr;
var fFolderQuickLaunch;
var is_winnt;
var szCurrentVersion;
var restrictedAccess;
var ikwDefined;
var folderQuickLaunchExists;
winreg = getWinRegistry();
fWindows = getFolder("Windows");
@ -125,9 +128,24 @@ function createShortcuts()
valname = "SendTo";
szFolderSendTo = winreg.getValueString(subkey, valname);
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups";
valname = "Quick Launch";
szFolderQuickLaunch = winreg.getValueString(subkey, valname);
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
valname = "AppData";
szFolderAppData = winreg.getValueString(subkey, valname);
// locate the Quick Launch folder
szFolderQuickLaunch = szFolderAppData + "\\Microsoft\\Internet Explorer\\Quick Launch";
fFolderQuickLaunch = getFolder("file:///", szFolderQuickLaunch);
folderQuickLaunchExists = File.exists(fFolderQuickLaunch);
if(!folderQuickLaunchExists)
{
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups";
valname = "Quick Launch";
szFolderQuickLaunch = winreg.getValueString(subkey, valname);
folderQuickLaunchExists = File.exists(fFolderPath);
if(folderQuickLaunchExists)
fFolderQuickLaunch = getFolder("file:///", szFolderQuickLaunch);
}
logComment("folderQuickLaunchExists: " + folderQuickLaunchExists);
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main";
valname = "Program Folder Path";
@ -163,6 +181,10 @@ function createShortcuts()
/* create the shortcuts */
File.windowsShortcut(fileExe, fFolderPath, scExeDesc, fProgram, scParam, fileExe, 0);
// create shortcut in the Quick Launch folder
if(folderQuickLaunchExists)
File.windowsShortcut(fileExe, fFolderQuickLaunch, scExeDesc, fProgram, "", fileExe, 0);
if(!restrictedAccess)
{
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);

Просмотреть файл

@ -6174,6 +6174,7 @@ HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize)
char szValue[MAX_BUF];
char szWRMSCurrentVersion[] = "Software\\Microsoft\\Windows\\CurrentVersion";
char szWRMSShellFolders[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
char szWRMSMapGroup[] = "Software\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroup";
/* zero out the memory allocations */
@ -6270,6 +6271,14 @@ HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize)
GetWinReg(HKEY_LOCAL_MACHINE, szWRMSShellFolders, "Common Desktop", szVariable, dwVariableSize);
}
}
else if(lstrcmpi(szVariable, "QUICK_LAUNCH") == 0)
{
/* parse for the "C:\WINNT40\Profiles\%USERNAME%\Application Data\Microsoft\Internet Explorer\Quick Launch" directory */
GetWinReg(HKEY_CURRENT_USER, szWRMSShellFolders, "AppData", szBuf, sizeof(szBuf));
wsprintf(szVariable, "%s\\Microsoft\\Internet Explorer\\Quick Launch", szBuf);
if(!FileExists(szVariable))
GetWinReg(HKEY_CURRENT_USER, szWRMSMapGroup, "Quick Launch", szVariable, dwVariableSize);
}
else if(lstrcmpi(szVariable, "PERSONAL_STARTUP") == 0)
{
/* parse for the "C:\WINNT40\Profiles\%USERNAME%\Start Menu\Programs\Startup" directory */