Skip to content
Open
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
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/new_node_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ body:
placeholder: ex. 0.0.0.20240513
validations:
required: true
- type: input
id: arguments
attributes:
label: Arguments
description: |
Command-line arguments to pass to the tool when running it from the `Tools` directory. For example `--help`.
placeholder: ex. --help
- type: dropdown
id: category
validations:
Expand Down
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/new_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ body:
placeholder: ex. 1.4.11
validations:
required: true
- type: input
id: arguments
attributes:
label: Arguments
description: |
Command-line arguments to pass to the tool when running it from the `Tools` directory. For example `--help`.
placeholder: ex. --help
- type: dropdown
id: category
validations:
Expand Down
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/new_python_tool_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ body:
placeholder: ex. 1.4.11
validations:
required: true
- type: input
id: arguments
attributes:
label: Arguments
description: |
Command-line arguments to pass to the tool when running it from the `Tools` directory. For example `--help`.
placeholder: ex. --help
- type: dropdown
id: category
validations:
Expand Down
13 changes: 13 additions & 0 deletions packages/capesolo.vm/capesolo.vm.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>capesolo.vm</id>
<version>0.4.23</version>
<authors>kevoreilly, enzok, doomedraven</authors>
<description>test</description>
<dependencies>
<dependency id="common.vm" version="0.0.0.20241209" />
<dependency id="python3.vm" />
</dependencies>
</metadata>
</package>
9 changes: 9 additions & 0 deletions packages/capesolo.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'CAPEsolo'
$category = 'Debuggers'
$version = '==0.4.23'
$arguments = '--update-yara'

VM-Install-With-Pip -toolName $toolName -category $category -version $version -arguments $arguments
7 changes: 7 additions & 0 deletions packages/capesolo.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'CAPEsolo'
$category = 'Debuggers'

VM-Uninstall-With-Pip $toolName $category
22 changes: 18 additions & 4 deletions scripts/utils/create_package_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ def package_version(dependency_version):

$zipUrl = '{target_url}'
$zipSha256 = '{target_hash}'
$arguments = '{arguments}'

VM-Install-From-Zip $toolName $category $zipUrl -zipSha256 $zipSha256 -consoleApp ${console_app} -innerFolder ${inner_folder}
VM-Install-From-Zip $toolName $category $zipUrl -zipSha256 $zipSha256 -consoleApp ${console_app} -innerFolder ${inner_folder} -arguments $arguments
"""

"""
Expand All @@ -120,8 +121,9 @@ def package_version(dependency_version):

$toolName = '{tool_name}'
$category = '{category}'
$arguments = '{arguments}'

VM-Install-Node-Tool -toolName $toolName -category $category -arguments "--help"
VM-Install-Node-Tool -toolName $toolName -category $category -arguments $arguments
"""

"""
Expand Down Expand Up @@ -155,8 +157,9 @@ def package_version(dependency_version):

$exeUrl = '{target_url}'
$exeSha256 = '{target_hash}'
$arguments = '{arguments}'

VM-Install-Single-Exe $toolName $category $exeUrl -exeSha256 $exeSha256 -consoleApp ${console_app}
VM-Install-Single-Exe $toolName $category $exeUrl -exeSha256 $exeSha256 -consoleApp ${console_app} -arguments $arguments
"""

"""
Expand Down Expand Up @@ -200,8 +203,9 @@ def package_version(dependency_version):
$toolName = '{tool_name}'
$category = '{category}'
$version = '=={version}'
$arguments = '{arguments}'

VM-Install-With-Pip -toolName $toolName -category $category -version $version
VM-Install-With-Pip -toolName $toolName -category $category -version $version -arguments $arguments
"""

"""
Expand Down Expand Up @@ -267,6 +271,7 @@ def create_zip_exe_template(packages_path, **kwargs):
target_hash=kwargs.get("target_hash"),
console_app=kwargs.get("console_app"),
inner_folder=kwargs.get("inner_folder"),
arguments=kwargs.get("arguments"),
)


Expand All @@ -281,6 +286,7 @@ def create_node_template(packages_path, **kwargs):
description=kwargs.get("description"),
tool_name=kwargs.get("tool_name"),
category=kwargs.get("category"),
arguments=kwargs.get("arguments"),
)


Expand Down Expand Up @@ -311,6 +317,7 @@ def create_single_exe_template(packages_path, **kwargs):
description=kwargs.get("description"),
tool_name=kwargs.get("tool_name"),
category=kwargs.get("category"),
arguments=kwargs.get("arguments"),
target_url=kwargs.get("target_url"),
target_hash=kwargs.get("target_hash"),
console_app=kwargs.get("console_app"),
Expand Down Expand Up @@ -358,6 +365,7 @@ def create_pip_template(packages_path, **kwargs):
description=kwargs.get("description"),
tool_name=kwargs.get("tool_name"),
category=kwargs.get("category"),
arguments=kwargs.get("arguments"),
)

def create_template(
Expand All @@ -377,6 +385,7 @@ def create_template(
dependency="",
console_app="",
inner_folder="",
arguments="",
):
pkg_path = os.path.join(packages_path, f"{pkg_name}.vm")
try:
Expand Down Expand Up @@ -408,6 +417,7 @@ def create_template(
tool_name=tool_name,
version=version,
category=category,
arguments=arguments,
target_url=target_url,
target_hash=target_hash,
shim_path=shim_path,
Expand Down Expand Up @@ -470,6 +480,7 @@ def get_script_directory():
"description",
"tool_name",
"category",
"arguments",
],
},
"SINGLE_EXE": {
Expand All @@ -486,6 +497,7 @@ def get_script_directory():
"target_url",
"target_hash",
"console_app",
"arguments",
],
},
"SINGLE_PS1": {
Expand Down Expand Up @@ -529,6 +541,7 @@ def get_script_directory():
"description",
"tool_name",
"category",
"arguments",
],
},
}
Expand Down Expand Up @@ -601,6 +614,7 @@ def main(argv=None):
parser.add_argument("--shim_path", type=str, default="", help="Metapackage shim path")
parser.add_argument("--console_app", type=str, default="false", choices=["false", "true"], help="The tool is a console application, the shortcut should run it with `cmd /K $toolPath --help` to be able to see the output.")
parser.add_argument("--inner_folder", type=str, default="false", choices=["false", "true"], help="The ZIP file unzip to a single folder that contains all the tools.")
parser.add_argument("--arguments", type=str, required=False, default="", help="Command-line arguments for the execution")
args = parser.parse_args(args=argv)

if args.type is None:
Expand Down
4 changes: 2 additions & 2 deletions scripts/utils/create_package_template_from_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def main():
for k, v in pkg.items():
if k in ("why", "dependencies", "info"):
continue
cmd_args.append(f"--{k}")
cmd_args.append(f"{v}")
# Use "--argument=<value>" format to avoid issues with if the value contains "-"
cmd_args.append(f"--{k}={v}")

create_package_template.main(cmd_args)

Expand Down
Loading