This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Windows file compression
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
Aug 23, 2010
10:27 AM
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;
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;
(1) Reply
Aug 23, 2010
11:34 AM
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.
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.