Skip to content

Commit

Permalink
Adding support for package script
Browse files Browse the repository at this point in the history
  • Loading branch information
RadAd committed Jan 31, 2022
1 parent e807de1 commit f3a6847
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
6 changes: 6 additions & 0 deletions RMSKIN.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[rmskin]
Name=Virtual Desktop Plugin Demo
Author=Adam Gates
Version=1.1
MinimumRainmeter=4.5.9.3592
MinimumWindows=10.0
16 changes: 16 additions & 0 deletions Utils/MakeRmsSkin.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$target = $args[0]

Write-Output "Writing footer..."
$size = [long](Get-Item $target).length
$size_bytes = [System.BitConverter]::GetBytes($size)
Add-Content -Path $target -Value $size_bytes -Encoding Byte

$flags = [byte]0
Add-Content -Path $target -Value $flags -Encoding Byte

$rmskin = [string]"RMSKIN`0"
Add-Content -Path $target -Value $rmskin -NoNewLine -Encoding ASCII

Write-Output "Changing .zip to .rmskin"
Rename-Item -Path $target -NewName ([io.path]::ChangeExtension($target, '.rmskin'))
$target = $target.Replace(".zip", ".rmskin")
20 changes: 20 additions & 0 deletions Utils/Package.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@setlocal
echo off
prompt $G$S
set name=Virtual.Desktop.Plugin.Demo_1.1

echo on
@call :safemkdir Plugins
@call :safemkdir Plugins\32Bit
@call :safemkdir Plugins\64Bit
copy Bin\Win32Release\VirtualDesktop.dll Plugins\32Bit
copy Bin\x64Release\VirtualDesktop.dll Plugins\64Bit
if exist %name%.zip del %name%.zip
7z a %name%.zip Plugins Skins RMSKIN.ini
del %name%.rmskin
powershell -File MakeRmsSkin.ps1 %name%.zip
@goto :eof

:safemkdir %1
if not exist %1 mkdir %1
@goto :eof

0 comments on commit f3a6847

Please sign in to comment.