Quick Launch Folder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • csd214
    Forum Member
    • Oct 2001
    • 939

    Quick Launch Folder

    Previously there have been some questions about the Quick Launch folder (in the AMS and the SUF forum). Due to a thread in the AMS50 forum I started to write a function to find the QL folder path. The intention was to create a function usable in both SUF70 and AMS50 (thanks to the common LUA engine) and to support all OSes.

    I have tested the function with Win98 (Norwegian), WinNT4 (English) and WinXP (English). It would be nice if any of you would test the function; and please: Report the result.

    The function is shown below. To call the function:
    Per-User-Profile
    sQLpathUser = GetQuickLaunchFolder() or sQLpathUser = GetQuickLaunchFolder("user")
    All Users Profile
    sQLpathCommon = GetQuickLaunchFolder("common")
    If you want to download a ready-to-use sf7 project I have attached a zipped project file (with the function in 'Global Actions').

    Code:
    function GetQuickLaunchFolder(profileArg)
    --[[
    function:	GetQuickLaunchFolder()
    Purpose:	Get the full path to the Quick Launch Folder
    Arguments:	(String)'user' = Current user's pahth [or no argument]
    			(String) 'common' [or no argument] = All Users path
    Returns:	String (full path [without a trailing slash])
    
    Usage:		sQLpath = GetQuickLaunchFolder()			= Current user's path
    			sQLpath = GetQuickLaunchFolder("user")		= Current user's path
    			sQLpath = GetQuickLaunchFolder("common")	= All Users path
    ]]
    	if not profileArg then
    		-- nil as argument
    		profileArg = "user";
    	end
    	if type(profileArg) ~= "string" then
    		Dialog.Message("Function GetQuickLaunchFolder()", "Argument 1 must be of type string"..
    			"\r\neither 'common' og 'user' or a nil value (='user')"..
    			"\r\nThe argument sent was of type "..type(profileArg));
    			profileArg = "user";
    	end
    	profileArg = String.Lower(profileArg);	-- always use lower case 
    	if profileArg ~= "common" and profileArg ~= "user" then profileArg = "user" end
    	-- incorrect argument, set it to default value 'user'
    
    	-- WinXP:  NOT in Registry
    	-- Win2k:  NOT in Registry
    	
    	-- WinNT:  -- Registry Key
    	-- Win9x:  -- Registry Key
    	-- [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GrpConv\MapGroups]
    	-- Value "Quick Launch"				
    
    	sPath = Shell.GetFolder(SHF_APPLICATIONDATA);
    	-- returns: 
    	-- WinXP:  C:\Documents and Settings\<UserName>\Application Data
    	-- Win2k:  Like WinXP??											
    	-- WinNT:  C:\WINNT\Profiles\<UserName>\Application Data 		
    	-- Win9x:  C:\WINDOWS\Application Data
    	--		sPath can be used as FIRST part of the folderpath (all systems)
    	--		but we have to add the second part of the path (fixed value)
    	--		This is for the current user's Quick Launch folder
    	--		From Win2k off there are two folders: Common and Per-User (= "New systems")
    	--		"Old systems" have only one folder (common = per-user) and the folder path can be found in the Registry
    	--		The segregation is NOT bundled to NT-based system or not...
    	
    	if profileArg == "common" then
    		-- Is the QL Folder path found in the Registry?
    		-- If YES: A non-NT based system ot NT3 or NT4 ("0ld OS")
    		-- If NO:  "New OS" like Win2k or WinXP
    		sQLKey = "Software\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups";
    		sQLRegPath = Registry.GetValue(HKEY_CURRENT_USER, sQLKey, "Quick Launch", true);
    		
    		if sQLRegPath ~= "" then
    			-- old system
    			sPath = sQLRegPath;
    		else
    			-- new system
    			tLANinfo = System.GetLANInfo();
    			nPos = String.Find(sPath, tLANinfo.User, 1, false);
    			if nPos ~= -1 then
    			-- the User Name was found
    				sPath = String.Replace(sPath, tLANinfo.User, "All Users", false);
    			end
    			--now add part 2
    			sPath = sPath.."\\Microsoft\\Internet Explorer\\Quick Launch"	-- without trailing slash!
    		end
    	else
    			--now add part 2
    			sPath = sPath.."\\Microsoft\\Internet Explorer\\Quick Launch"	-- without trailing slash!
    	end
    	
    	return sPath
    
    end
    Good luck; and please remember to publish your test results if you find the function usable. Tell about your OS version (+ language version).
    Attached Files
  • csd214
    Forum Member
    • Oct 2001
    • 939

    #2
    I do not understand Microsoft...

    If you add a shortcut to "C:\Documents and Settings\All Users\Application Data\Microsoft\Internet Explorer\Quick Launch\" nobody can see it! If you check 'Show Quick Launch' in the taskbar properties this applies to the current user's Quick Launch folder. To see the 'All Users Quick Launch' you have to define a new toolbar and point to the appropriate folder. Then you will have TWO SEPARATE Quick Launch toolbars (see attachment).

    If you really want that ALL USERS shall have the Quick Launch shortcut you have to create the shortcut in each account's Application Data\Microsoft\Internet Explorer\Quick Launch. Microsoft seems to do it that way (Launch Internet Explorer Browser.lnk and Show Desktop.scf). If you want to use GetQuickLaunchFolder(); use it without any argument.

    Why couldn't MS do a merging like they do with the 'Desktop' folders? I have searched the MS site but couldn't find anything about the issue:

    To overcome this "problem" I made these extensions:

    When the 'All User' profile is selected, create the shortcut in Quick Launch USER folder *AND* ALL USERS folder. (The All Users folder is used as a storage space for the next option.)

    Create a Start Menu option: "Create Quick Launch shortcut"
    This option is for other users of the system. It calls a simple script that copies the .lnk from ALL USERS folder to current user's folder. I created the script with AutoIt and compiled to QuickLaunch.exe (87 KB). The shortcut description is found in QuickLaunch.ini.

    The SUF70 app creates the ini file. If another user of the system installs the Quick Launch shortcut, it would NOT be found in the SUF70 uninstall data list. Because of this I added a scan of all profiles as an uninstall action. All shortcuts with the defined description are deleted by the uninstaller.

    I find it cumbersome to implement the Quick Launch option. Several of my users have a delimited Windows account. All installations has to be done by the IT manager, and HE does not need a shortcut on HIS Quick Launch toolbar, but the app user might.

    Personally I never check the 'Quick Launch' option if the installer asks me. I prefer to add it to the toolbar later on when I know my usage of the app. That's why I don't like installers that create the shortcut WITHOUT ASKING me! (What about installers selecting the application folder and the shortcut folder without asking the user? The setup designer should have used SUF70).

    Another solution; may be the best one:
    Checkbox: Do you want to create a Quick Launch shortcut in a Windows account of your choice?

    Then display another screen with a checkbox for each account on the system.
    Attached Files

    Comment

    Working...
    X