Skip to content

Commit

Permalink
Add arguments to shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
reuteras committed Jan 27, 2024
1 parent 6433208 commit 62655c0
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions setup/wscommon.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Set variables
$DATA = "C:\data"
$ENRICHMENT = "C:\enrichment"
$GIT = "C:\git"
$GIT_PATH = "C:\git"
$LOCAL_PATH = "C:\local"
$NEO_JAVA = "C:\java"
$PDFSTREAMDUMPER = "C:\Sandsprite\PDFStreamDumper"
$PDFSTREAMDUMPER_PATH = "C:\Sandsprite\PDFStreamDumper"
$RUST_DIR = "C:\Rust"
$SETUP_PATH = "C:\downloads"
$TEMP = "C:\tmp"
Expand All @@ -13,9 +13,9 @@ $VENV = "C:\venv"
$POWERSHELL_EXE = "${env:ProgramFiles}\PowerShell\7\pwsh.exe"

$null="${DATA}"
$null="${GIT}"
$null="${GIT_PATH}"
$null="${LOCAL_PATH}"
$null="${PDFSTREAMDUMPER}"
$null="${PDFSTREAMDUMPER_PATH}"
$null="${RUST_DIR}"

# Declare helper functions
Expand Down Expand Up @@ -65,7 +65,8 @@ function Add-Shortcut {
[string]$DestinationPath,
[string]$WorkingDirectory,
[string]$Iconlocation,
[switch]$IconArrayLocation
[switch]$IconArrayLocation,
[string]$Arguments
)
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = ${WshShell}.CreateShortcut("${SourceLnk}")
Expand All @@ -78,6 +79,9 @@ function Add-Shortcut {
}
${Shortcut}.Iconlocation = "${Iconlocation}, ${IconArrayLocation}"
}
if ($Null -ne ${Arguments}) {
${Shortcut}.Arguments = "${Arguments}"
}
${Shortcut}.TargetPath = "${DestinationPath}"
${Shortcut}.Save()
}
Expand Down Expand Up @@ -113,7 +117,8 @@ function Install-Apimonitor {

function Install-Autopsy {
Write-Output "Installing Autopsy"
msiexec.exe /i "${SETUP_PATH}\autopsy.msi" /qn /norestart
Copy-Item "${SETUP_PATH}\autopsy.msi" "${TEMP}\autopsy.msi"
Start-Process -Wait msiexec.exe -ArgumentList "/i ${TEMP}\autopsy.msi /qn /norestart"
}

function Install-BashExtra {
Expand Down Expand Up @@ -180,7 +185,7 @@ function Install-LibreOffice {
function Install-Loki {
Write-Output "Installing Loki"
& "${env:ProgramFiles}\7-Zip\7z.exe" x -aoa "${SETUP_PATH}\loki.zip" -o"${env:ProgramFiles}\"
Copy-Item $GIT\signature-base "${env:ProgramFiles}\loki" -Recurse
Copy-Item ${GIT_PATH}\signature-base "${env:ProgramFiles}\loki" -Recurse
}

function Install-Malcat {
Expand Down

0 comments on commit 62655c0

Please sign in to comment.