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: Compress Drive Check funtion broken in 2012
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2013
10:05 AM
Compress Drive Check funtion broken in 2012
The following code has worked in previous versions of InstallShield, but now is broken in the 2012 Spring release. This is for an Installscript MSI project. The same code in a 2010 project doesn't display the Msgbox, but does for 2012.
Any ideas??
// Included header files ----------------------------------------------------
#include "ifx.h"
#define FILE_ATTRIBUTE_COMPRESSED 0x800
prototype Kernel32.GetFileAttributes(BYVAL STRING);
function OnBegin()
begin
if (Kernel32.GetFileAttributes(INSTALLDIR) & FILE_ATTRIBUTE_COMPRESSED) then
MessageBox("App cannot be installed into a folder that is compressed.",SEVERE);
abort;
endif;
end;
Any ideas??
// Included header files ----------------------------------------------------
#include "ifx.h"
#define FILE_ATTRIBUTE_COMPRESSED 0x800
prototype Kernel32.GetFileAttributes(BYVAL STRING);
function OnBegin()
begin
if (Kernel32.GetFileAttributes(INSTALLDIR) & FILE_ATTRIBUTE_COMPRESSED) then
MessageBox("App cannot be installed into a folder that is compressed.",SEVERE);
abort;
endif;
end;
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2013
11:37 AM
I suspect this is not an issue with the change in the IDE to IS2012 Spring, rather the fact that this Win32 API has different behavior depending on whether the path is a local path or a remote path and different behavior on different OS. See this link.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364944(v=vs.85).aspx
I suggest refactoring the code to get the return code.
nReturn = Kernel32.GetFileAttributes(INSTALLDIR);
Then if INVALID_FILE_ATTRIBUTES is returned, use the InstallScript Err object to find out the last error code.
nDllReturned = Err.LastDllError;
And use that to determine what the problem is. From the above documentation you would to pass a network share to the code as you presented it.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364944(v=vs.85).aspx
I suggest refactoring the code to get the return code.
nReturn = Kernel32.GetFileAttributes(INSTALLDIR);
Then if INVALID_FILE_ATTRIBUTES is returned, use the InstallScript Err object to find out the last error code.
nDllReturned = Err.LastDllError;
And use that to determine what the problem is. From the above documentation you would to pass a network share to the code as you presented it.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2013
04:34 PM
This is probably a Unicode related issue raised at the IS2010 to IS2011 migration border. See the release notes of IS2011 for full information, or change one of the following:
- prototype Kernel32.GetFileAttributes(BYVAL WSTRING)
- prototype Kernel32.GetFileAttributesA(BYVAL STRING)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 13, 2013
11:15 AM
That worked MU.