Hi. I have included the vc_redist.x86.exe with my Inno Setup installer and the inno script to install it if it’s not already installed and this works fine on Window 8.1 but for some reason a user reported that my app wouldn’t launch due to “api-ms-win-crt-heap-11-1-0.dll” being missing.
They told me they had updated their system via Windows Update to the latest version and uninstalled and reinstalled my app and rebooted and still no joy.
So I tried myself removing this dll from my own version of Windows 8.1 and sure enough my app wouldn’t launch so I then installed my app using my setup file and even though it installed the vc_redist.x86.exe correctly (as seen in Control Panel > Programs and Features) it did not install the dll I had manually removed from Windows/System32 folder.
FYI: I am using 14.0.24215.1 version of Redistributable file from April this year.
I’ve had a similar problem occur at a number of end-user sites, and not as a result of deleting a particular .DLL. It seems that on some systems the combination of InnoSetup and the vc_redistx86.exe installer can’t update the Windows 10 Universal C Runtime.
When that happens, our support team asks customers to go to this page and manually download and install the correct runtime for their system. It’s a bit more work but it solves the issue. If anybody has an easier, more foolproof method then I’d love to hear about it.
Strange. Yes, I gave the user this link (https://support.microsoft.com/en-us/help/3118401/update-for-universal-c-runtime-in-windows) to the msu installer and that solved it for them but that’s not really the best solution and you’d think the redistributable should work, especially if it does add it to Control Panel etc. Do you think it’s possible it’s an Administrator issue when running the InnoSetup installer simply as a user or that the InnoSetup script needs another permissions flag?
Those sound like possibilities to me but I don’t know. I spent years as “the InstallShield guy” in a previous company but I’m a rookie with InnoSetup. It’d be good if some others with possible solutions and more experience in this area would join this thread.
[Files]
Source: "..\\Distribution\\Runtime\\vc_redist.x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion
[Run]
Filename: {tmp}\\vc_redist.x86.exe; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Microsoft Visual C++ Redistributable on x86 ...."; Check: not VCinstalled; Flags: waituntilterminated
`
function VCinstalled: Boolean;
// Returns True if Microsoft Visual C++ Redistributable is installed, otherwise False.
// The programmer may set the year of redistributable to find; see below.
var
names: TArrayOfString;
i: Integer;
dName, key, year: String;
begin
// Year of redistributable to find; leave null to find installation for any year.
year := '';
Result := False;
key := 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall';
// Get an array of all of the uninstall subkey names.
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, key, names) then
// Uninstall subkey names were found.
begin
i := 0
while ((i < GetArrayLength(names)) and (Result = False)) do
// The loop will end as soon as one instance of a Visual C++ redistributable is found.
begin
// For each uninstall subkey, look for a DisplayName value.
// If not found, then the subkey name will be used instead.
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, key + '\\' + names[i], 'DisplayName', dName) then
dName := names[i];
// See if the value contains both of the strings below.
Result := (Pos(Trim('Visual C++ ' + year),dName) * Pos('Redistributable',dName) <> 0)
i := i + 1;
end;
end;
end;
I’ve had to put the “code” section in angled brackets so it displays correctly here on the forum.
Due to the number of installations where the redist won’t run, or where it runs but doesn’t complete I’ve gone back to including the dll’s next to the executable.
I went back and reread your original post and you said that you manually removed the dll from your system. Doing that doesnt let the system know that the component has been removed and Im guessing that when you reinstall the system says, I already have this, dont run again.
Hmm. I couldn’t think of any other way to replicate the user’s issue since unistalling the redistributable package did not remove those dlls. In the latest Windows 8.1 they must be part of the system.
[quote=347952:@Denise Adams]Hi. I have included the vc_redist.x86.exe with my Inno Setup installer and the inno script to install it if it’s not already installed and this works fine on Window 8.1 but for some reason a user reported that my app wouldn’t launch due to “api-ms-win-crt-heap-11-1-0.dll” being missing.
They told me they had updated their system via Windows Update to the latest version and uninstalled and reinstalled my app and rebooted and still no joy.
So I tried myself removing this dll from my own version of Windows 8.1 and sure enough my app wouldn’t launch so I then installed my app using my setup file and even though it installed the vc_redist.x86.exe correctly (as seen in Control Panel > Programs and Features) it did not install the dll I had manually removed from Windows/System32 folder.
FYI: I am using 14.0.24215.1 version of Redistributable file from April this year.
Any ideas what is going on here?[/quote]
First thing to note:
Regardless of x86 or x64 Windows,
vc_redist.x86.exe for 32-bit app, vc_redist.x64.exe for 64-bit app.
Second to note:
In a x86 Windows,
vc_redist.x86.exe should install into \Windows\System32
vc_redist.x64.exe cannot be installed
In a x64 Windows,
vc_redist.x86.exe should install into \Windows\SysWOW64
vc_redist.x64.exe should install into \Windows\System32
Third to note:
If yours is a x64 Windows, the dlls you manually deleted from \Windows\System32 is not from vc_redist.x86.exe.
Hi Cho. Thanks for the clarification. The system I was testing on was Windows 8.1 32bit and I deleted the dll from \Windows\System32. The dll was the same one that was missing form my user’s system and when I deleted it my app threw the same error. The same dll is included in the Xojo “files” folder of individual dlls as the alternative option to the .exe so I just assumed that same dll would be included in the .exe and installed into \Windows\System32. It may be as Greg suggested that Windows thinks that the dll is installed due to perhaps a registry entry even though it was deleted and so maybe doesn’t try and put it back.
Performing an install of an already installed redistributable will not replace randomly missing files as the system already thinks its correctly installed (just a reg check).
If the file isn’t being replace on install, try the following to perform a repair (which should put the file back)
\vcredist_x.exe /q /repair /norestart
If this works, you might want to change your install script to repair if its already installed (just to make sure), or install if its not.
I have suffered so much from DLL problems over the years that now I default to putting all required DLLs in the application directory, and I have my installer automatically overwrite anything exiting.
[quote=348271:@]Performing an install of an already installed redistributable will not replace randomly missing files as the system already thinks its correctly installed (just a reg check).
If the file isn’t being replace on install, try the following to perform a repair (which should put the file back)
\vcredist_x.exe /q /repair /norestart
If this works, you might want to change your install script to repair if its already installed (just to make sure), or install if its not.[/quote]
Thanks, Julian. I will give this a try and report back.