Skip to content

Commit cf00760

Browse files
committed
osfmount instead of imdisk
1 parent 5d741c7 commit cf00760

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed
+26-17
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
1-
name: "Setup ImDisk"
1+
name: "Setup OSFMount"
22
if: runner.os == 'Windows'
33
description: |
4-
Sets up the ImDisk toolkit for Windows and creates a RAM disk on drive R:.
4+
Installs OSFmount for Windows and creates a RAM disk on drive R:.
55
runs:
66
using: "composite"
77
steps:
8-
- name: Download ImDisk
8+
- name: Install OSFMount
99
if: runner.os == 'Windows'
10-
shell: bash
10+
shell: pwsh
1111
run: |
12-
mkdir imdisk
13-
cd imdisk
14-
curl -L -o files.cab https://github.com/coder/imdisk-artifacts/raw/92a17839ebc0ee3e69be019f66b3e9b5d2de4482/files.cab
15-
curl -L -o install.bat https://github.com/coder/imdisk-artifacts/raw/92a17839ebc0ee3e69be019f66b3e9b5d2de4482/install.bat
16-
cd ..
17-
18-
- name: Install ImDisk
19-
shell: cmd
20-
run: |
21-
cd imdisk
22-
install.bat /silent
12+
$ErrorActionPreference = "Stop"
13+
& curl.exe `
14+
--progress-bar `
15+
--show-error `
16+
--fail `
17+
--location `
18+
--output osfmount.exe `
19+
$env:OSFMOUNT_URL
20+
if ($LASTEXITCODE -ne 0) { throw "Failed to download osfmount.exe" }
21+
if ((Get-FileHash osfmount.exe -Algorithm SHA256).Hash -ne $env:OSFMOUNT_SHA256) {
22+
throw "Failed to verify osfmount.exe"
23+
}
24+
& .\osfmount.exe /silent /norestart
25+
if ($LASTEXITCODE -ne 0) { throw "Failed to install osfmount.exe" }
26+
Remove-Item osfmount.exe
27+
env:
28+
OSFMOUNT_URL: https://storage.googleapis.com/coder-osfmount-binaries/osfmount-v3.1.1003.exe
29+
OSFMOUNT_SHA256: 9fe0738b7c2d29a7414e67f53aea359f3801d1c37b44f1b4fed5d02cb7536369
2330

2431
- name: Create RAM Disk
25-
shell: cmd
32+
shell: pwsh
2633
run: |
27-
imdisk -a -s 4096M -m R: -p "/fs:ntfs /q /y"
34+
$ErrorActionPreference = "Stop"
35+
& OSFMount.com -a -s 4096M -m R: -o logical,format:NTFS
36+
if ($LASTEXITCODE -ne 0) { throw "Failed to create RAM disk" }

0 commit comments

Comments
 (0)