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

flare-vm & boxstarter 3.0.0 doesn't support Chocolatey 2 (use of deprecated cinst) #456

Closed
DanAsBjorn opened this issue Jun 3, 2023 · 8 comments · Fixed by #462
Closed
Assignees
Labels
🐛 bug Something isn't working

Comments

@DanAsBjorn
Copy link

Installing fails after clicking ok on the GUI part of install with the output

common.vm v0.0.0.20230526 (forced)
common.vm package files install completed. Performing other installation steps.
[+] VM_COMMON_DIR set to: C:\ProgramData\_VM
[+] PSModulePath set to: C:\ProgramData\_VM;C:\ProgramData\Boxstarter;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
[+] TOOL_LIST_DIR set to: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Tools
[+] TOOL_LIST_SHORTCUT set to: C:\Users\Dan\Desktop\Tools.lnk
[+] RAW_TOOLS_DIR set to: C:\Tools
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of common.vm was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.

Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Refreshing environment variables from the registry for powershell.exe. Please wait...
Finished
chocolatey : The term 'chocolatey' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\ProgramData\_VM\vm.common\vm.common.psm1:843 char:18
+     $chocoInfo = chocolatey --version
+                  ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (chocolatey:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

Looking at line 843-846 of C:\ProgramData_VM\vm.common\vm.common.psm1 it looks like it is using the command chocolatey rather than choco

$chocoInfo = chocolatey --version
  $installedPackages = chocolatey list -l -r -all
  $boxstarerInfo = $installedPackages | Select-String -Pattern "Boxstarter" | Out-String
  $installedPackages = $installedPackages | Out-String

Example:

PS C:\Windows\system32> chocolatey --version
chocolatey : The term 'chocolatey' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ chocolatey --version
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (chocolatey:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Windows\system32> choco --version
2.0.0
PS C:\Windows\system32>

looks like 843 and 844 need changing to choco.

@DanAsBjorn
Copy link
Author

I am running chocolatey version 2.0

@DanAsBjorn
Copy link
Author

mandiant/VM-Packages#409

Looks like the issue

@moatazabdullah
Copy link

moatazabdullah commented Jun 3, 2023

I have the same issue, you can run this command "Set-Alias -Name chocolatey -Value choco".
It worked for me!

@DanAsBjorn
Copy link
Author

cool, pretty simple! I just ended up deleting chocolatey and running $env:chocolateyVersion = '1.4.0' before the install script

@basegdp
Copy link

basegdp commented Jun 3, 2023

Setting the Alias fixed the issue for me however is now resulting in a call depth overflow. See error below.

"Invoke-ChocolateyBoxstarter : The script failed due to call depth overflow.
At line:1 char:151

  • ... meChecking; Invoke-ChocolateyBoxstarter -bootstrapPackage 'flarevm.in"

Any idea how to resolve?

@moatazabdullah
Copy link

moatazabdullah commented Jun 3, 2023

Reinstalling chocolatey with version 1.4.0 should fix the issue.

$env:chocolateyVersion = '1.4.0'

Run this in powershell and run the install.ps1 script it should work

@Ana06
Copy link
Member

Ana06 commented Jun 5, 2023

This is caused by Boxstarter not being compatible with Chocolatey 2 (released few days ago) as it uses the deprecated (now removed) cinst. As @moatazabdullah mentions, you can run $env:chocolateyVersion = '1.4.0' before installing flare-vm till chocolatey/boxstarter#533 fix is merged and released.

@Ana06
Copy link
Member

Ana06 commented Jun 6, 2023

We should update the boxstarter version check after chocolatey/boxstarter#533 is released (it is already merged)

@Ana06 Ana06 changed the title Install failing - choclately is not recognized - vm.common.psm1 issue Boxstarter 3.0.0 doesn't support Chocolatey 2 (use of deprecated cinst) Jun 6, 2023
@Ana06 Ana06 self-assigned this Jun 7, 2023
@Ana06 Ana06 changed the title Boxstarter 3.0.0 doesn't support Chocolatey 2 (use of deprecated cinst) flare-vm & boxstarter 3.0.0 doesn't support Chocolatey 2 (use of deprecated cinst) Jun 7, 2023
@Ana06 Ana06 added the 🐛 bug Something isn't working label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants