Skip to content

Commit

Permalink
[microsoft-office.vm] Add verification & shortcuts
Browse files Browse the repository at this point in the history
Ensure Office tools useful for malware analysis are installed and create
shortcuts in the Tools directory to make accessing them easier.
  • Loading branch information
Ana06 committed Feb 4, 2025
1 parent 89b8091 commit 6e0b389
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 18 additions & 0 deletions packages/microsoft-office.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,26 @@ $ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$tools = @(
@{name = 'Word'; executable = 'WINWORD.EXE'},
@{name = 'Excel'; executable = 'EXCEL.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 /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 6e0b389

Please # to comment.