totheendoftheworld
totheendoftheworld

Reputation: 73

Setup has detected that vcredist_x64\vc_redist.x64.exe has been changed since it was initially published

I've been trying to make an installer for an exe file, yet I can't seem to get it work. Whenever the setup.exe is run, it errors with the message

Setup has detected that C:\Users[name]\AppData\Local\Temp\VSD4F7F.tmp\vcredist_x64\vc_redist.x64.exe has been changed since it was initially published

I attempted to make it download from the same location as my PC, but that too didn't work as when it was building the solution it errored saying that the files were not found. I put the right files in the Packages folder, yet it still didn't work.

For reference, I'm using a 64 bit PC to develop, the exe was designed for 64 bit, and the clean PC that I'm testing on is 64 bit. I'm also using Windows 10 and Visual Studio 2019.

Upvotes: 5

Views: 5099

Answers (1)

TomislavG
TomislavG

Reputation: 53

I have the same issue, and I found sort of a workaround:

It seems that when installer creates bootstrapper (the setup.exe) it embeds information from C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\product.xml. More precisely, it seems to embed the public key of the vc++ redistributable in the setup.

When user runs the setup, bootstrapper downloads the vcredist from Microsoft's web (in my case https://aka.ms/vs/16/release/vc_redist.x64.exe) and checks the digital signature. If the public key of the downloaded file doesn't match the embedded one in setup, you get the error.

Now, I managed to fix it (sort of) by manually editing C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\product.xml putting the downloaded vcredist public key into the xml file and rebuilding the installer project.

However, if Microsoft again changes the signature on vcredist, my setup will start throwing errors again.

It is driving me insane. I'm considering: a) removing the prerequisite from my installer and instructing users to install vcredist themselves or b) Hosting vcredist on my own website (and checking "Download prerequisites from the same location as my application)

Both of these solutions have significant drawbacks and yet, updating setup each time Microsoft releases "new" vcredist is not an option either

Upvotes: 2

Related Questions