Windows installation issue

Hello
I cannot install swift (either from winget or .exe) on my Company Windows 11 PC with an anti virus managed by IT team that I cannot disable:
Your log: Error 0x80070005: Failed to write run key value.
Anti virus Log: swift-5.10.1-RELEASE-windows10.exe, which tried to access HKCU\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUNONCE{339EDC9D-7392-4603-8E39-610B4D6D356F}, violating the rule "Registering of programs to autorun", and was blocked.

Can you provide an install option to disable autorun please ? It is the only way I can install it, IT team don't want to listen anything. Thanks a lot

I would like to know too why the autorun is needed. @compnerd

Nothing in the installer uses auto run. The problem here is most likely that windows file system model doesn’t allow writing files if they are in use. If you reboot before installing this will likely not happen. You’re welcome to look at the installer rules in swiftlang/swift-installer-scripts.

1 Like

I have the same error after a fresh reboot:

Registering bundle dependency provider: {339EDC9D-7392-4603-8E39-610B4D6D356F}, version: 5.10.1
Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{339EDC9D-7392-4603-8E39-610B4D6D356F}, resume: Active, restart initiated: No, disable resume: No
Error 0x80070005: Failed to write run key value.
Error 0x80070005: Failed to update resume mode.
Error 0x80070005: Failed to begin registration session.
Error 0x80070005: Failed to register bundle.

I think that you are just out of luck with your restrictive corporate environment. I doubt anyone on this forum can give you a recipe for circumventing it.

Do you have an older installation of Swift by any chance? I think that this might be in the upgrade path?

You can try using some kind of virtualization, e.g. if you can install VirtualBox, then Registry and other local restrictions should not apply to the guest OS inside the VirtualBox, you will have full control over it. Network restrictions may still apply though.

One thing to note, before the reboot, the HKCU key being written was a run once (for exec after reboot most likely). Post reboot, the access denied is for the registration key which means it is getting further. However, the logs are truncated and do not indicate the hive being written to. Is that HKCU or HKLM?

HKCU:
HKCU\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUNONCE{339EDC9D-7392-4603-8E39-610B4D6D356F}

It is first time installation. Someone can give me what is it written in the registry at this path ? Maybe if the value is already there it won't write it again...

That is the older run - the path changed between the reboot. This is not something explicitly written, this is just an internal detail of how MSIs work, so you would need to ask Microsoft.