Skip to content

Commit

Permalink
Merge pull request #1265 from Ana06/office
Browse files Browse the repository at this point in the history
[microsoft-office.vm] Improve installation params & add verification + shortcuts
  • Loading branch information
Ana06 authored Feb 6, 2025
2 parents 7be7ad3 + 5d55bbe commit 3254380
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
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

0 comments on commit 3254380

Please # to comment.