Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shimgen not creating shims, with error 'Could not execute CVTRES.EXE.' #209

Open
Balfa opened this issue Oct 27, 2022 · 4 comments
Open
Labels
0 - _Triaging New tickets that need to be hashed out a bit more before they hit the backlog. 0 - Waiting on User Waiting on a response from either a commenter or ticket creator. shimgen

Comments

@Balfa
Copy link

Balfa commented Oct 27, 2022

What You Are Seeing?

I am seeing all packages (that otherwise install successfully) not have shims created for them.

What is Expected?

The packages get shims created in C:\ProgramData\chocolatey\bin so that they can be executed easily from anywhere.

How Did You Get This To Happen? (Steps to Reproduce)

  1. I ran this command choco install make -dv
  2. The package was downloaded correctly but no shim was created.
  3. I can run C:\ProgramData\chocolatey\lib\make\tools\install\bin\make.exe and get correct output: make: *** No targets specified and no makefile found. Stop.
  4. But I cannot just run make.exe or make from any location: make.exe: The term 'make.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

System Details

  • OS Build (In PowerShell run [System.Environment]::OSVersion.version.tostring()): 10.0.19045.0
  • Windows PowerShell version (Run: $PSVersionTable): 7.2.6
  • Chocolatey version (Run choco --version): 1.1.0

Output Log

See https://gist.github.com/Balfa/fc254362476f406b226162d791d23c21

┆Issue is synchronized with this Gitlab issue by Unito
┆Link To Issue: https://gitlab.com/chocolatey/collaborators/shimgen/-/issues/39

@corbob
Copy link
Member

corbob commented Oct 28, 2022

It looks like perhaps your .net framework install is corrupted somehow. One of the answers to a similar issue on stackoverflow hinted at a repair tool from Microsoft, or perhaps running sfc /scannow since the framework is built into windows.

@Balfa
Copy link
Author

Balfa commented Oct 28, 2022

I tried sfc /scannow, I tried the .NET Framework Repair Tool, I tried copying cvtres.exe & cvtres.exe.config from C:\Windows\Microsoft.NET\Framework\v4.0.30319 to C:\Windows\Microsoft.NET\Framework\v2.0.50727, and I tried a Visual Studio Installer Repair. Nothing helped :(

@corbob
Copy link
Member

corbob commented Nov 1, 2022

🤔 I'm not sure where else to look with this. I'm seeing no issues on Windows 10 21h2, 22h1, and 22h2 (10.0.19043-19045), nor in Windows 11..

This seems very unlikely, but perhaps it's something to do with 32 vs 64 bit... Could you try launching C:\Windows\SysWOW64\cmd.exe as an administrator and then running C:\ProgramData\chocolatey\tools\shimgen.exe --path="..\\lib\make\tools\install\bin\make.exe" --output="C:\ProgramData\chocolatey\bin\make.exe" --iconpath="C:\ProgramData\chocolatey\lib\make\tools\install\bin\make.exe" to see it it works? If that works, then try removing the file C:\ProgramData\chocolatey\bin\make.exe before running the choco install make command again (you may need to uninstall make or force the install with --force).

@corbob corbob added 0 - _Triaging New tickets that need to be hashed out a bit more before they hit the backlog. 0 - Waiting on User Waiting on a response from either a commenter or ticket creator. labels Nov 1, 2022
@Balfa
Copy link
Author

Balfa commented Nov 1, 2022

No dice :/

# C:\ProgramData\chocolatey\tools\shimgen.exe --path="..\\lib\make\tools\install\bin\make.exe" --output="C:\ProgramData\chocolatey\bin\make.exe" --iconpath="C:\ProgramData\chocolatey\lib\make\tools\install\bin\make.exe"
[WARN ] Could not extract icon from associated program. Using default. Error:
  Selected Icon is invalid
Microsoft (R) Visual C# Compiler version 4.8.4084.0

for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.



This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240

error CS0016: Could not write to output file 'c:\ProgramData\chocolatey\bin\make.exe' -- 'Could not execute CVTRES.EXE.'


[ERROR] ShimGen had an issue creating 'C:\ProgramData\chocolatey\bin\make.exe'. Please check the logs above.

It's a work laptop with some restricted privileges, so I feel like it might be related to that, but I wish I could see even which CVTRES.EXE it was trying to execute, and with what parameters...
When I run C:\Windows\Microsoft.NET\Framework64\v4.0.30319\cvtres.exe from the same prompt, a blank terminal window appears and disappears in the blink of an eye

@pauby pauby added the shimgen label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - _Triaging New tickets that need to be hashed out a bit more before they hit the backlog. 0 - Waiting on User Waiting on a response from either a commenter or ticket creator. shimgen
Projects
None yet
Development

No branches or pull requests

3 participants