|
#1
|
||||
|
||||
|
Windows Localizations cause File.Find to act differently?
Has anyone spotted any situation where a windows localization caused File.Find() to act differently?
I was helping someone in Norway clean up old shortcuts. The code I used is posted below for peer-review. He reported that *ALL* his shortcuts were removed, but not the folders... The only way I can think of this happening is file.find() returned a list of all files... Since I was doing this gratis, I did only cursory tests; which didn't yeild any problems, but it was not on a norway windows. I do not know what his version of windows was; but from the screen shot he sent; it appeared to be XP. He's obviously (and understandably) rather miffed (****ed?); regardless of if he wants me to help him further; I want to know what went wrong.... Global Functions Code:
Custom={};
function Custom.RemoveMyOldShortcuts( cFolder, bKeepFolder )
local tShortcuts = File.Find(cFolder, "Embla Familie og Slekt*.lnk", true, true);
if tShortcuts then
local x;
for x = 1, Table.Count(tShortcuts) do
File.Delete(tShortcuts[x], false, false, false);
if not bKeepFolder then
Folder.Delete( String.PathOnly( tShortcuts[x] ) );
end
end
end
local tFolders = Folder.Find(cFolder, "Embla Familie og Slekt*", true);
if tFolders then
local x;
for x = 1, Table.Count(tFolders) do
Folder.Delete( tFolders[x] );
end
end
end
function String.PathOnly( cFQP )
local tParts = String.SplitPath(cFQP);
local cReturn = tParts.Drive..tParts.Folder;
if String.Right(cReturn,1)=="\\" then
cReturn = String.Left(cReturn,String.Length(cReturn)-1);
end
return cReturn;
end
-- Remove Code:
From various locations Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_DESKTOP) ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_DESKTOP_COMMON) ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_STARTMENU) ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_STARTMENU_COMMON) ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_STARTMENUPROGRAMS) ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_STARTMENUPROGRAMS_COMMON) ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_DESKTOP) ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_APPLICATIONDATA) .. "\\Microsoft\\Internet Explorer\\Quick Launch", true ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_APPLICATIONDATA_LOCAL) .. "\\Microsoft\\Internet Explorer\\Quick Launch", true ); Custom.RemoveMyOldShortcuts( Shell.GetFolder(SHF_APPLICATIONDATA_COMMON) .. "\\Microsoft\\Internet Explorer\\Quick Launch",true ); |
|
#2
|
||||
|
||||
|
I see the error in my ways -- what I sent out was not what I tested..
file.find -- true,false Not sure how that got changed.... |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dependency Module: Windows Installer (MSI) 4.5 | venky | MSI Factory 2.0 Examples & Modules | 2 | 3 Weeks Ago 11:39 AM |
| attempting to compare a variable with the contents of an array | Lucian Cain | AutoPlay Media Studio 5.0 | 4 | 10-17-2006 04:10 PM |
| INFO: JET and MDAC (Complete) Runtime Notes | Desmond | Setup Factory 6.0 Knowledge Base | 0 | 11-28-2003 09:35 AM |
| INFO: Setup Factory and the Windows Installer | Support | Setup Factory 6.0 Knowledge Base | 0 | 10-22-2002 11:38 AM |
| HOWTO: Install Files to the Windows Directory | Support | Setup Factory 6.0 Knowledge Base | 0 | 09-18-2002 03:33 PM |
All times are GMT -6. The time now is 01:44 PM.








Linear Mode

