cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mary_v
Level 6

Windows file compression

Hi there,

i've got something weird i think - my function (see below) checks on compressed files - well it did until i migrated to is2011:

in is2010 my function returns - if a file really is NOT compressed - an iAttributes value 32

in is2011 the same function returns, same condition as before, an iAttributes value -1 for every file.

Could someone give me a quick hint where and what to look for?
(OS Windows 7 x86)

Thanks
Mary

function BOOL IsFileCompressed(filename)

INT iAttributes, nResult;
STRING sRes;

begin

iAttributes = GetFileAttributes(filename);
NumToStr(sRes, iAttributes);
MessageBox(sRes + " - " + filename, 0);
return (iAttributes & 0x800) == 0x800;

end;
Labels (1)
0 Kudos
(1) Reply
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Can you change your code to call GetFileAttributesW instead and test again? Due to the Unicode changes made to the InstallScript engine, calling any Win32 API without specifying which thunk version to use (A/ANSI or W/Unicode) will now default to calling the Unicode (W) version of the API (technically an API named GetFileAttributes does not exist as an export of Kernel32).

Also note that GetFileAttributesA and GetFileAttributesW are already prototyped by the InstallScript headers, which were updated with the Unicode changes to provide prototypes of the W versions of Win32 APIs. In order for this issue to occur, GetFileAttributes would need to have been prototyped directly in the project being built.

Note that due to the changes in the InstallScript engine, it is recommended that the article "Upgrading Projects to InstallShield 2011" be reviewed to understand these changes, and to determine what may be necessary to change when upgrading a project to IS 2011.
0 Kudos