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

WinPB: Update Wix Installation To Install SDK #3624

Merged
merged 8 commits into from
Jun 26, 2024

Conversation

steelhead31
Copy link
Contributor

@steelhead31 steelhead31 commented Jun 25, 2024

Update the Wix5 installation task, as the .NET SDK is not installed by default, and the wix installation requires it.

This also addresses a bug, where the playbook incorrectly uses sudo as a become method, which should be runas in Windows.

Fixes #3617

Checklist

@steelhead31 steelhead31 marked this pull request as ready for review June 25, 2024 14:37
Copy link
Contributor

@andrew-m-leonard andrew-m-leonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gdams
Copy link
Member

gdams commented Jun 26, 2024

I've just been chatting to the .NET team, there are dotnet-install scripts you can use. For example:

# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"

# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"

This would prevent us having to update the checksum etc

@steelhead31
Copy link
Contributor Author

I've just been chatting to the .NET team, there are dotnet-install scripts you can use. For example:

# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"

# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"

I tried those, but they install the .net SDK in a user specific folder, which then isn't available to the jenkins user.. as we run the playbooks as an administrator user, but these tools are needed for the jenkins user.

@gdams
Copy link
Member

gdams commented Jun 26, 2024

I've just been chatting to the .NET team, there are dotnet-install scripts you can use. For example:

# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"

# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"

I tried those, but they install the .net SDK in a user specific folder, which then isn't available to the jenkins user.. as we run the playbooks as an administrator user, but these tools are needed for the jenkins user.

Can you not run them as the jenkins user?

@steelhead31
Copy link
Contributor Author

I've just been chatting to the .NET team, there are dotnet-install scripts you can use. For example:

# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"

# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"

I tried those, but they install the .net SDK in a user specific folder, which then isn't available to the jenkins user.. as we run the playbooks as an administrator user, but these tools are needed for the jenkins user.

Can you not run them as the jenkins user?

Let me give them a quick test. I had issues with the become user elements on our playbook checker ( its on an old version of ansible which has issues... that's a separate issue Im already looking into )

@steelhead31
Copy link
Contributor Author

I've tried running both as jenkins, as it doesn't get added to the path, it ends up in a <>/.dotnet folder, I think the current solution is more reliable, so I'll leave it like this, as it does work with GHA, and when running the playbooks to build normal machines.

@steelhead31 steelhead31 merged commit 810b20c into adoptium:master Jun 26, 2024
9 checks passed
@steelhead31 steelhead31 deleted the fix_wix5_install branch June 26, 2024 10:36
aswinkr77 pushed a commit to aswinkr77/infrastructure that referenced this pull request Jun 27, 2024
* WinPB: Update Wix Installation To Install SDK and use correct windows become method.

* Linter Fix.

* Linter Fix: FQ Run As Method

* WindowsPB: Remove redundant output var

* WinPB: Update VS2022 CE Download Checksum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ansible Windows Playbook Fails On Wix 5.0 Installation / Windows Server 2022
3 participants