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
- :
- FindFile error
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
‎Aug 02, 2011
08:46 AM
FindFile error
I want to check if the visual studio 2010 DLL's are installed in setup.rul
This code works fine on windows 7 x64/win32 but not on Windows 2008.
Any idea? Is there a FindFile problem on Windows 2008 server?
The code uses FindFile to check if the f.i. c:\windows\system32\mfc100.dll exists. It finds the file on Windows 7, but not on a Windows 2008 server, allthough the file is there when I check it with the windows explorer.
function OnBegin()
STRING szResult;
STRING szSystemRoot;
STRING szDir;
STRING szMsg;
int nResult;
STRING szMFC;
begin
// Search information
szMFC = "MFC100.DLL";
GetEnvVar( "SYSTEMROOT", szSystemRoot);
szDir = szSystemRoot ^ "system32" ;
SdShowMsg( "Checking " + szDir, TRUE);
nResult = FindFile( szDir, szMFC, szResult);
if( nResult < 0 ) then
szMsg = "The " + szDir + "\\" + szMFC + " dll has not been installed\n";
SdShowMsg( "", FALSE);
MessageBox( szMsg, SEVERE );
abort;
endif;
SdShowMsg( "", FALSE);
end;
This code works fine on windows 7 x64/win32 but not on Windows 2008.
Any idea? Is there a FindFile problem on Windows 2008 server?
The code uses FindFile to check if the f.i. c:\windows\system32\mfc100.dll exists. It finds the file on Windows 7, but not on a Windows 2008 server, allthough the file is there when I check it with the windows explorer.
function OnBegin()
STRING szResult;
STRING szSystemRoot;
STRING szDir;
STRING szMsg;
int nResult;
STRING szMFC;
begin
// Search information
szMFC = "MFC100.DLL";
GetEnvVar( "SYSTEMROOT", szSystemRoot);
szDir = szSystemRoot ^ "system32" ;
SdShowMsg( "Checking " + szDir, TRUE);
nResult = FindFile( szDir, szMFC, szResult);
if( nResult < 0 ) then
szMsg = "The " + szDir + "\\" + szMFC + " dll has not been installed\n";
SdShowMsg( "", FALSE);
MessageBox( szMsg, SEVERE );
abort;
endif;
SdShowMsg( "", FALSE);
end;
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 02, 2011
11:43 AM
If this is a 64-bit installation of Windows Server 2008, does disabling file system redirection before calling FindFile change the behavior (%systemroot%\Sysnative can also be used without disabling file system redirection on Windows Vista and newer)? The FindFile function is basically a wrapper around the Win32 FindFirstFile/FindNextFile functions and therefore could be affected by file system behavior on a target machine.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 03, 2011
03:56 AM
Hi Josh, thanks for the hint. First I checked my Windows 7 x64 development workstation: de Visual Studio 2010 x86 runtime was also installed, and yes: the mfc100.dll was also in the C:\windows\syswow64 folder. When i removed it, same problem as on Windows server 2008 (indeed x64).
So i modified my setup.rul and this works.
Maybe something to set on the request list for version 2012?
Luc
prototype BOOL kernel32.Wow64DisableWow64FsRedirection(BYREF INT);
prototype BOOL kernel32.Wow64EnableWow64FsRedirection(BYREF INT);
function OnBegin()
STRING szResult;
STRING szSystemRoot;
STRING szDir;
STRING szMsg;
int nResult;
STRING szMFC;
INT dwOldValue;
BOOL bResult;
begin
// Search information
szMFC = "MFC100.DLL";
GetEnvVar( "SYSTEMROOT", szSystemRoot);
szDir = szSystemRoot ^ "system32" ;
SdShowMsg( "Checking " + szDir, TRUE);
// Disable SysWOW64 redirection
bResult = Wow64DisableWow64FsRedirection( dwOldValue );
nResult = FindFile( szDir, szMFC, szResult);
// Enable SysWOW64 redirection
bResult = Wow64EnableWow64FsRedirection( dwOldValue );
if( nResult < 0 ) then
szMsg = "The " + szDir + "\\" + szMFC + " dll has not been installed\n";
SdShowMsg( "", FALSE);
MessageBox( szMsg, SEVERE );
abort;
endif;
SdShowMsg( "", FALSE);
end;
So i modified my setup.rul and this works.
Maybe something to set on the request list for version 2012?
Luc
prototype BOOL kernel32.Wow64DisableWow64FsRedirection(BYREF INT);
prototype BOOL kernel32.Wow64EnableWow64FsRedirection(BYREF INT);
function OnBegin()
STRING szResult;
STRING szSystemRoot;
STRING szDir;
STRING szMsg;
int nResult;
STRING szMFC;
INT dwOldValue;
BOOL bResult;
begin
// Search information
szMFC = "MFC100.DLL";
GetEnvVar( "SYSTEMROOT", szSystemRoot);
szDir = szSystemRoot ^ "system32" ;
SdShowMsg( "Checking " + szDir, TRUE);
// Disable SysWOW64 redirection
bResult = Wow64DisableWow64FsRedirection( dwOldValue );
nResult = FindFile( szDir, szMFC, szResult);
// Enable SysWOW64 redirection
bResult = Wow64EnableWow64FsRedirection( dwOldValue );
if( nResult < 0 ) then
szMsg = "The " + szDir + "\\" + szMFC + " dll has not been installed\n";
SdShowMsg( "", FALSE);
MessageBox( szMsg, SEVERE );
abort;
endif;
SdShowMsg( "", FALSE);
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 04, 2011
11:57 AM
Can you clarify what change you would like to see with the FindFile function? Are you referring to checking both the native System32 folder and the SysWOW64 folder? A change such as this may have unintended consequences if a caller of the function is expecting to only find the requested file(s) in a specific folder (since FindFile does not return any path with files found, there would be no way to differentiate between multiple copies in the x64 and x86 system folders).