diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index 5406ad06..75b98970 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -66,4 +66,9 @@ jobs: name: JAR_Files path: artifacts/jars/ if-no-files-found: error + - name: ZIP_Files + uses: actions/upload-artifact@v3 + with: + path: tools/tcg_rim_tool/build/distributions/*.zip + \ No newline at end of file diff --git a/package/win/tcg-rim-tool/create_hirstools_desktop_shortcut.ps1 b/package/win/tcg-rim-tool/create_hirstools_desktop_shortcut.ps1 new file mode 100644 index 00000000..748b2126 --- /dev/null +++ b/package/win/tcg-rim-tool/create_hirstools_desktop_shortcut.ps1 @@ -0,0 +1,7 @@ + +# Create a shortcut to start the RIM shell +$WshShell = New-Object -comObject WScript.Shell +$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\HIRS_tools.lnk") +$Shortcut.TargetPath = "$PWD\hirsshell.ps1" +$Shortcut.WorkingDirectory = "$PWD" +$Shortcut.Save() diff --git a/package/win/tcg-rim-tool/eventLog.ps1 b/package/win/tcg-rim-tool/eventLog.ps1 new file mode 100644 index 00000000..7307cd50 --- /dev/null +++ b/package/win/tcg-rim-tool/eventLog.ps1 @@ -0,0 +1,11 @@ +# Script to run the tcg_rim_tool in java + +$JavaParams = @{ + FilePath = 'java' + ArgumentList = @( + '-jar "{0}"' -f "$PWD\tcg_eventlog_tool-2.1.3.jar" + "$args" + ) +} + +Start-Process @JavaParams -NoNewWindow -Wait \ No newline at end of file diff --git a/package/win/tcg-rim-tool/hirsshell.ps1 b/package/win/tcg-rim-tool/hirsshell.ps1 new file mode 100644 index 00000000..ae85c109 --- /dev/null +++ b/package/win/tcg-rim-tool/hirsshell.ps1 @@ -0,0 +1,15 @@ +# Script to start a new shell with a rim alias +$StartInfo = new-object System.Diagnostics.ProcessStartInfo +$StartInfo.FileName = "$pshome\powershell.exe" +$StartInfo.Arguments = "-NoExit -Command + `$Host.UI.RawUI.WindowTitle=`'TCG RIM TOOL`'; + Set-Alias elt '$PWD\eventlog.ps1'; + Set-Alias rim '$PWD\rim.ps1'; + # function rim { java -jar 'tcg_rim_tool-2.1.0.jar' $args; }; + echo 'The TCG RIM TOOL is intended for testing TCG Defined PC Client Reference Integrity Manifests (RIMs)'; + echo 'for usage type: rim -h'; + echo 'for eventlog usage type: elt -h' + Set-Location -Path $PWD; + function prompt {'HIRS > '};" +[System.Diagnostics.Process]::Start($StartInfo) + diff --git a/package/win/tcg-rim-tool/rim.ps1 b/package/win/tcg-rim-tool/rim.ps1 new file mode 100644 index 00000000..75168c6a --- /dev/null +++ b/package/win/tcg-rim-tool/rim.ps1 @@ -0,0 +1,11 @@ +# Script to run the tcg_rim_tool in java + +$JavaParams = @{ + FilePath = 'java' + ArgumentList = @( + '-jar "{0}"' -f "$PWD\tcg_rim_tool-2.1.0.jar" + "$args" + ) +} + +Start-Process @JavaParams -NoNewWindow -Wait \ No newline at end of file diff --git a/tools/tcg_rim_tool/build.gradle b/tools/tcg_rim_tool/build.gradle index fc39524c..6f507255 100644 --- a/tools/tcg_rim_tool/build.gradle +++ b/tools/tcg_rim_tool/build.gradle @@ -131,3 +131,37 @@ buildRpm { buildDeb { arch = 'amd64' } + +task buildZip(type: Zip){ + dependsOn jar + from(tasks.jar.archiveFile){ + into '/' + } + from('README.md') { + into '/' + } + from('./build/resources/test/rim_fields.json'){ + into '/' + } + from('../../package/win/tcg_rim_tool/rim.ps1'){ + into '/' + } + from('../../package/win/tcg_rim_tool/hirsshell.ps1'){ + into '/' + } + from('../../package/win/tcg_rim_tool/eventLog.ps1'){ + into '/' + } + from('../../package/win/tcg_rim_tool/create_hirstools_desktop_shortcut.ps1'){ + into '/' + } + +// arch = 'win' + // project_subproject-release version_data-git commit hash-arch.extension + archiveBaseName.set(project.name + '-' + jarVersion) + archiveExtension.set('zip') + destinationDirectory.set(file("$buildDir/distributions")) +} + +buildZip.dependsOn jar +//build.dependsOn buildZip \ No newline at end of file