Skip to content
New issue

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

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

Already on GitHub? # to your account

[microsoft-office.vm] Improve installation params & add verification + shortcuts #1265

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/microsoft-office.vm/microsoft-office.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>microsoft-office.vm</id>
<version>0.0.0.20250123</version>
<description>Microsoft Office ProPlusRetail</description>
<version>0.0.0.20250203</version>
<description>Microsoft Office ProPlus2024Retail.</description>
<authors>Microsoft</authors>
<dependencies>
<dependency id="common.vm" />
Expand Down
22 changes: 21 additions & 1 deletion packages/microsoft-office.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,28 @@ $ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$tools = @(
@{name = 'Word'; executable = 'WINWORD.EXE'},
@{name = 'Excel'; executable = 'EXCEL.EXE'},
@{name = 'PowerPoint'; executable = 'POWERPNT.EXE'},
@{name = 'OneNote'; executable = 'ONENOTE.EXE'}
)
$category = 'Documents'
$shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category

# Install with choco instead as dependency to provide params such the product
choco install microsoft-office-deployment --params="'/DisableUpdate:TRUE /Language:en-us /Product:ProPlusRetail'" --no-progress
choco install microsoft-office-deployment --params="'/DisableUpdate:TRUE /Product:ProPlus2024Retail'" --no-progress

# Find the directory where the tools are installed
$officeDirectory = Resolve-Path "C:\Program Files**\Microsoft Office\root\Office16" | Select-Object -first 1

# Ensure the tools are installed and create shortcuts
forEach ($tool in $tools) {
$executablePath = Join-Path $officeDirectory $($tool.executable) -Resolve
$shortcut = Join-Path $shortcutDir "$($tool.name).lnk"
Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executablePath
VM-Assert-Path $shortcut
}
} catch {
VM-Write-Log-Exception $_
}
1 change: 0 additions & 1 deletion scripts/test/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ class UsesInvalidCategory(Lint):
"installer.vm",
"libraries.python2.vm",
"libraries.python3.vm",
"microsoft-office.vm",
"notepadpp.plugin.",
"npcap.vm",
"openjdk.vm",
Expand Down
Loading