Reputation: 71
I have created a DOS command call in my Install Shield script C:\Windows\System32\PnPutil.exe -a "C:\Program Files (x86)\Anite\Drivers\SPS\ftdiport.inf"
When running my InstallShield program on a Windows 64 bit PC (double click on the Setup.exe file) this command always gives a return code 2 (The system cannot find the file specified. Indicates that the file cannot be found in specified location). However when I open a CMD window (as Administrator) on the same PC and run the exact same DOS command from the same location as the setup.exe file, it always works. I know that when our InstallShield script runs, it does so in Elevated Mode so issuing this command from InstallShiled should be the same as running it from CMD in Administrator Mode. However it fails in the first case but is successful in the second.
Also note that when I run the same InstallShield program on a Windows 32 bit PC, the command always works C:\Windows\System32\PnPutil.exe -a "C:\Program Files \Anite\Drivers\SPS\ftdiport.inf"
There seems to be a problem on Win 64 bit OS with running this DOS command from InstallShield script, in that it cannot locate the file in the Program Files (x86) area. Also this issue only seems to occur when invoking the pnputil utility - all other utilities (e,g regsvr32.exe) are invoked without any issues.
Any advice or help given would be greatly appreciated. Many thanks in advance.
Upvotes: 2
Views: 924
Reputation: 71
I found out how to fix this issue.What I found is that when you build an image with 32 bit Install Shield program, it has a setting (WOW64FSREDIRECTION) that automatically re-directs all 64 bit applications and system calls to the C:\Windows\SysWOW64 directory, so in this case this was causing the pnputil command call to fail because it is not located in that directory (hence the error code "The system cannot find the file specified") but in the system32 directory. I used the installshield routine "Disable (WOW64FSREDIRECTION)", which overwrites this property, and this fixed the issue – the commands were sucessfully executed from the system32 directory.
Upvotes: 2