Skip to content

Commit

Permalink
vm.common: add -iconLocation param to VM-Install-From-Zip function
Browse files Browse the repository at this point in the history
  • Loading branch information
fariss committed Dec 12, 2024
1 parent 5fe6f9d commit 777a5c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/common.vm/common.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>common.vm</id>
<version>0.0.0.20241106</version>
<version>0.0.0.20241212</version>
<description>Common libraries for VM-packages</description>
<authors>Mandiant</authors>
</metadata>
Expand Down
10 changes: 6 additions & 4 deletions packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ function VM-Install-From-Zip {
# $powershellCommand = "Get-Content README.md"
# $powershellCommand = "Import-Module module.ps1; Get-Help Main-Function"
[Parameter(Mandatory=$false)]
[string] $powershellCommand
[string] $powershellCommand,
[Parameter(Mandatory=$false)]
[string] $iconLocation
)
try {
$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName
Expand Down Expand Up @@ -432,20 +434,20 @@ function VM-Install-From-Zip {

if ($powershellCommand) {
$executablePath = $toolDir
VM-Install-Shortcut -toolName $toolName -category $category -arguments $powershellCommand -executableDir $executablePath -powershell
VM-Install-Shortcut -toolName $toolName -category $category -arguments $powershellCommand -executableDir $executablePath -powershell -iconLocation $iconLocation
}
elseif ($withoutBinFile) { # Used when tool does not have an associated executable
if (-Not $executableName) { # Tool is located in $toolDir (c3.vm for example)
$executablePath = $toolDir
} else { # Tool is in a specific directory (pma-labs.vm for example)
$executablePath = Join-Path $toolDir $executableName -Resolve
}
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -iconLocation $iconLocation
}
else {
if (-Not $executableName) { $executableName = "$toolName.exe" }
$executablePath = Join-Path $toolDir $executableName -Resolve
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -consoleApp $consoleApp -arguments $arguments
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -consoleApp $consoleApp -arguments $arguments -iconLocation $iconLocation
Install-BinFile -Name $toolName -Path $executablePath
}
return ,@($toolDir, $executablePath)
Expand Down

0 comments on commit 777a5c4

Please sign in to comment.