|
|||
|
Hi,
Currently have an installer app that needs to create a lot of shortcuts to the desktop and the start menu. However, using getSpecialFolder("startup all") or getSpecialFolder("program files") seems to work OK when I use it on Windows 2000, but returns "C:\undefined\...." as a path with ME.... Can anyone else confirm this? If so we have a problem ;D Cheers, G. |
|
|||
|
Hi,
getSpecialFolder("startup all") works well on ME. getSpecialFolder("program files") cannot work But if you need to create shortcut on start menu, you should use getSpecialFolder("programs") The getSpecialFolder("program files") only works on NT, 2000, XP, it's a bug. If you want to get the "program files" folder on any windows platform, you should use the following code. Code:
function get_program_files_folder()
{
var str = Shell.getSpecialFolder("program files");
if (str == undefined)
{
var key = new RegKey("HKLM\\software\\microsoft\\windows\\currentversion");
str = key.getValue("ProgramFilesDir").data;
}
return str;
}
trace(get_program_files_folder());
|
|
|||
|
hmmm....
which other getSpecialFolder commands do not work under ME and 98? Currently the app also needs to write the files to the start menu->Programs for ALL users.... getSpecialFolder("programs all") and getSpecialFolder("startmenu all) don't seem to work either.... I think I may have to go back to the drawing board and check the users operating system, find the drive letter that has Windows on it, and then look for the relevant subfolders from there.... getSpecialFolders is just too buggy atm.... Thanks for your help anyway. G. |
|
|||
|
|
|
|||
|
Hi,
The parameters of the getSpecialFolder method can be divided into 5 types, 1. "windows" 2, "temp" 3. "system" 4. "program files" 5. all others The only bug is that getSpecialFolder("program files") cannot work on win9x. For type 5, not all parameters are valid for win9x. Eg. "programs all" is only valid for Windows NT, Windows 2000, and Windows XP http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp ***appdata CSIDL_APPDATA; cookies *********CSIDL_COOKIES; desktop *********CSIDL_DESKTOPDIRECTORY; desktopall *********CSIDL_COMMON_DESKTOPDIRECTORY; favorites *********CSIDL_FAVORITES; fonts *********CSIDL_FONTS; history *********CSIDL_HISTORY; internetcache ******CSIDL_INTERNET_CACHE; mydocuments ******CSIDL_PERSONAL; nethood *********CSIDL_NETHOOD; printers *********CSIDL_PRINTERS; programs *********CSIDL_PROGRAMS; programsall ******CSIDL_COMMON_PROGRAMS; recent ************CSIDL_RECENT; sendto ************CSIDL_SENDTO; startmenu *********CSIDL_STARTMENU; startmenuall ******CSIDL_COMMON_STARTMENU; startup *********CSIDL_STARTUP; startupall *********CSIDL_COMMON_STARTUP; templates *********CSIDL_TEMPLATES; |
|
|||
|
;D
Thanks for that link, it will be very useful for future reference. I assume your help pages will be updated in v2.0 to reflect this? I mean, it isn't like every SWFKit user will know what commands should and shouldn't work for each operating system, and it certainly has nothing about it in the current version.... I also think it is a little misleading to tell someone that a command works correctly when it actually doesn't. e.g. "startup all" does not work correctly on either 98 or ME. Sure, if you put an exe there it will start at boot time, but you can't see it in the Start Menu, and you can only delete it if you write a SWFKit command or manually delete it from Windows\All Users\Start Menu\Programs\Startup. Granted, that isn't entirely your fault (it looks like a Windows bug *shock horror*) but it still meant that I was wasting time trying to fix problems after being assured it would be alright.... Once again though, thanks for all your replies, the app was completed and seems to be working as hoped. G. |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|