vamp-mcp 0.2.0 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of vamp-mcp might be problematic. Click here for more details.
- package/LICENSE +21 -21
- package/README.md +144 -107
- package/THIRD_PARTY_NOTICES.md +32 -27
- package/bin/vamp-mcp.mjs +37 -37
- package/notices/mcp-virtualbox-LICENSE +21 -21
- package/notices/mcp-virtualbox-PROVENANCE.json +37 -37
- package/package.json +51 -17
- package/runtime/backends/common/Test-Environment.ps1 +7 -6
- package/runtime/backends/common/guest-install.json +58 -0
- package/runtime/backends/common/guest_install.py +57 -0
- package/runtime/backends/common/host-support.cjs +16 -0
- package/runtime/backends/common/packer.cjs +16 -0
- package/runtime/backends/hyperv/scripts/Manage-Desktop.ps1 +40 -67
- package/runtime/backends/hyperv/scripts/Send-InstallerBoot.ps1 +25 -0
- package/runtime/backends/kvm/debian-preseed.cfg +35 -35
- package/runtime/backends/library/registry.py +77 -77
- package/runtime/backends/library/replay.py +154 -154
- package/runtime/backends/packer/answer_media.py +16 -0
- package/runtime/backends/packer/deploy-hyperv.ps1 +10 -0
- package/runtime/backends/packer/drivers.py +49 -0
- package/runtime/backends/packer/hyperv-network.ps1 +10 -0
- package/runtime/backends/packer/images.py +75 -0
- package/runtime/backends/packer/osinfo.py +113 -0
- package/runtime/backends/packer/policy.json +15 -0
- package/runtime/backends/packer/runner.py +224 -0
- package/runtime/backends/packer/templates.py +118 -0
- package/runtime/backends/packer/toolchain.py +80 -0
- package/runtime/backends/remote_ssh/server.mjs +310 -93
- package/runtime/backends/virtualbox/desktop.cjs +37 -0
- package/runtime/backends/virtualbox/display.py +101 -101
- package/runtime/backends/virtualbox/history.py +139 -139
- package/runtime/backends/virtualbox/mouse_click.py +15 -15
- package/runtime/backends/virtualbox/mouse_move.py +18 -18
- package/runtime/backends/virtualbox/profiles.json +46 -46
- package/runtime/backends/virtualbox/provision.py +238 -197
- package/runtime/backends/virtualbox/recording_listener.py +29 -29
- package/runtime/backends/virtualbox/recordings.py +39 -39
- package/runtime/backends/virtualbox/requirements.txt +7 -7
- package/runtime/backends/virtualbox/rpas/debian_first_boot/manifest.json +1 -1
- package/runtime/backends/virtualbox/rpas/debian_first_boot/run.robot +13 -13
- package/runtime/backends/virtualbox/rpas/debian_first_boot/workflow.py +75 -75
- package/runtime/backends/virtualbox/rpas/observe/manifest.json +7 -7
- package/runtime/backends/virtualbox/rpas/observe/run.robot +13 -13
- package/runtime/backends/virtualbox/rpas/observe/workflow.py +14 -14
- package/runtime/backends/virtualbox/server.mjs +288 -237
- package/runtime/backends/virtualbox/setup_windows_sdk.py +58 -58
- package/runtime/backends/virtualbox/shares.py +68 -68
- package/runtime/backends/virtualbox/snapshots.py +53 -53
- package/runtime/backends/virtualbox/transfers.py +89 -89
- package/runtime/backends/virtualbox/vnc.py +61 -61
- package/runtime/guest_keys.py +13 -13
- package/runtime/guest_setup/http/debian-preseed.cfg +39 -0
- package/runtime/guest_setup/http/postdeb.sh +50 -3
- package/runtime/guest_setup/http/postwin.ps1 +53 -28
- package/runtime/guest_setup/http/setup-all.ps1 +25 -25
- package/runtime/guest_setup/http/setup-win.cmd +7 -7
- package/runtime/guest_setup/http/setup.ps1 +44 -29
- package/runtime/guest_setup/kvm/setup-windows.ps1 +52 -52
- package/runtime/guest_setup/recorder/README.txt +12 -12
- package/runtime/guest_setup/recorder/RECORDER-LICENSE +674 -674
- package/runtime/guest_setup/recorder/RECORDING-GUIDE.txt +31 -31
- package/runtime/guest_setup/recorder/apply-display.py +41 -41
- package/runtime/guest_setup/recorder/configure-debian-mirrors.py +62 -62
- package/runtime/guest_setup/recorder/configure-gdm.py +23 -0
- package/runtime/guest_setup/recorder/configure-session.ps1 +14 -0
- package/runtime/guest_setup/recorder/gnome-display.py +60 -60
- package/runtime/guest_setup/recorder/install-display-startup.py +67 -39
- package/runtime/guest_setup/recorder/install-hypervisor-drivers.ps1 +34 -0
- package/runtime/guest_setup/recorder/install-resolution-shortcut.ps1 +36 -0
- package/runtime/guest_setup/recorder/postwin.cmd +10 -10
- package/runtime/guest_setup/recorder/prepare-recording.py +30 -30
- package/runtime/guest_setup/recorder/requirements-recorder.txt +2 -2
- package/runtime/guest_setup/recorder/session-policy.py +22 -0
- package/runtime/guest_setup/recorder/set-resolution-registry.ps1 +40 -0
- package/runtime/guest_setup/recorder/setup-user.py +53 -53
- package/runtime/guest_setup/recorder/setup-win.cmd +4 -60
- package/runtime/guest_setup/recorder/setup.ps1 +112 -81
- package/runtime/guest_setup/recorder/setup.sh +1 -0
- package/runtime/guest_setup/recorder/vamp-recorder.py +148 -148
- package/runtime/guest_setup/recorder/verify-recorder.py +4 -4
- package/runtime/guest_setup/recorder/windows-display.py +76 -76
- package/runtime/guest_setup/requirements.txt +2 -2
- package/runtime/guest_setup/setup-all.ps1 +35 -35
- package/runtime/guest_setup/vault/Install-VCRuntime.ps1 +26 -26
- package/runtime/guest_setup/vault/setup-guest-vault.ps1 +148 -148
- package/runtime/recording_converter.py +230 -230
- package/runtime/requirements-mcp.txt +11 -11
- package/runtime/rpas/README.md +161 -161
- package/runtime/rpas/captcha_handoff/manifest.json +27 -27
- package/runtime/rpas/captcha_handoff/run.robot +16 -16
- package/runtime/rpas/captcha_handoff/workflow.py +11 -11
- package/runtime/rpas/common.resource +26 -26
- package/runtime/rpas/debian_update/manifest.json +27 -27
- package/runtime/rpas/debian_update/run.robot +17 -17
- package/runtime/rpas/debian_update/workflow.py +13 -13
- package/runtime/rpas/desktop_control/manifest.json +26 -26
- package/runtime/rpas/desktop_control/run.robot +27 -27
- package/runtime/rpas/desktop_control/workflow.py +51 -51
- package/runtime/rpas/firefox_launch/manifest.json +27 -27
- package/runtime/rpas/firefox_launch/run.robot +15 -15
- package/runtime/rpas/firefox_launch/workflow.py +25 -25
- package/runtime/rpas/firefox_naver/manifest.json +27 -27
- package/runtime/rpas/firefox_naver/run.robot +21 -21
- package/runtime/rpas/firefox_naver/workflow.py +28 -28
- package/runtime/rpas/kvm_validation/README.md +11 -11
- package/runtime/rpas/kvm_validation/manifest.json +28 -28
- package/runtime/rpas/kvm_validation/run.robot +30 -30
- package/runtime/rpas/kvm_validation/workflow.py +91 -91
- package/runtime/rpas/manifest.schema.json +105 -105
- package/runtime/rpas/naver_login/login.robot +25 -25
- package/runtime/rpas/naver_login/manifest.json +33 -33
- package/runtime/rpas/naver_login/run.robot +20 -20
- package/runtime/rpas/naver_login/workflow.py +32 -32
- package/runtime/rpas/windows_naver_recorded/README.md +24 -24
- package/runtime/rpas/windows_naver_recorded/conversion.json +25 -25
- package/runtime/rpas/windows_naver_recorded/manifest.json +28 -28
- package/runtime/rpas/windows_naver_recorded/run.robot +37 -37
- package/runtime/rpas/windows_naver_recorded/workflow.py +32 -32
- package/runtime/scripts/build_recorder_media.py +39 -39
- package/runtime/scripts/macos/setup-host.sh +0 -0
- package/runtime/scripts/script_server.py +571 -517
- package/runtime/skills/vamp-rpa-ui-checks/SKILL.md +26 -0
- package/runtime/skills/vamp-rpa-ui-checks/agents/openai.yaml +4 -0
- package/runtime/skills/vamp-rpa-ui-checks/references/display.md +12 -0
- package/runtime/skills/vamp-rpa-ui-checks/references/user-guide.md +51 -0
- package/runtime/skills/vamp-ui-cleanup/SKILL.md +15 -0
- package/runtime/skills/vamp-ui-cleanup/agents/openai.yaml +4 -0
- package/runtime/skills/vamp-ui-validation/SKILL.md +27 -0
- package/runtime/skills/vamp-ui-validation/agents/openai.yaml +4 -0
- package/runtime/third_party/mcp-virtualbox/scripts/mouse_click.py +65 -65
- package/runtime/third_party/pyautogui-recorder/LICENSE +674 -674
- package/runtime/third_party/pyautogui-recorder/PROVENANCE.json +16 -16
- package/runtime/third_party/pyautogui-recorder/PyAutoGuiRecorder.py +169 -169
- package/runtime/third_party/pyautogui-recorder/README.md +53 -53
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
"""Probe/install ONLY the open-source VNC extension and configure a loopback console."""
|
|
2
|
-
import hashlib
|
|
3
|
-
import json
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
import re
|
|
6
|
-
import sys
|
|
7
|
-
import tarfile
|
|
8
|
-
import xml.etree.ElementTree as ET
|
|
9
|
-
try:
|
|
10
|
-
from .display import command
|
|
11
|
-
from .provision import parse
|
|
12
|
-
except ImportError:
|
|
13
|
-
from display import command
|
|
14
|
-
from provision import parse
|
|
15
|
-
|
|
16
|
-
SOURCE='https://www.virtualbox.org/browser/vbox/trunk/src/VBox/ExtPacks/VNC'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def probe(run=command):
|
|
20
|
-
version=run('--version').strip();text=run('list','extpacks')
|
|
21
|
-
blocks=re.split(r'(?m)^Pack no\.\s*\d+:',text)[1:]
|
|
22
|
-
vnc=next((block for block in blocks if block.splitlines()[0].strip()=='VNC'),None)
|
|
23
|
-
usable=bool(vnc and re.search(r'(?m)^Usable:\s*true\s*$',vnc,re.I))
|
|
24
|
-
return {'status':'available' if usable else 'module_required','backend':'virtualbox','protocol':'vnc',
|
|
25
|
-
'virtualbox_version':version,'open_source_module':'VNC','module_usable':usable,
|
|
26
|
-
'oracle_extension_pack_required':False,'source':SOURCE}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def setup(vm=None,extpack_path=None,sha256=None,allow_install=False,port=5901,run=command):
|
|
30
|
-
state=probe(run)
|
|
31
|
-
if not state['module_usable'] and extpack_path:
|
|
32
|
-
if not allow_install:return {**state,'status':'install_not_requested'}
|
|
33
|
-
source=Path(extpack_path).expanduser().resolve(strict=True)
|
|
34
|
-
if not sha256 or hashlib.file_digest(source.open('rb'),'sha256').hexdigest().casefold()!=sha256.casefold():
|
|
35
|
-
raise ValueError('Provide the verified SHA-256 of the chosen VNC extension package')
|
|
36
|
-
with tarfile.open(source,'r:*') as archive:
|
|
37
|
-
metadata=next((member for member in archive.getmembers() if member.name=='ExtPack.xml'),None)
|
|
38
|
-
if metadata is None or metadata.size>65536:raise ValueError('Invalid extension package metadata')
|
|
39
|
-
root=ET.fromstring(archive.extractfile(metadata).read())
|
|
40
|
-
if root.findtext('Name')!='VNC':raise ValueError('Only the open-source VNC extension is accepted; Oracle Extension Pack is not installed')
|
|
41
|
-
version=root.find('Version')
|
|
42
|
-
package_version=(version.text or '').strip() if version is not None else ''
|
|
43
|
-
host_version=state['virtualbox_version'].split('_')[0].split('r')[0]
|
|
44
|
-
if package_version!=host_version:raise ValueError('VNC extension version must match the host VirtualBox version')
|
|
45
|
-
run('extpack','install','--replace',str(source))
|
|
46
|
-
state=probe(run)
|
|
47
|
-
if not vm or not state['module_usable']:return state
|
|
48
|
-
if not 1024<=int(port)<=65535:raise ValueError('Use an unprivileged VNC port in 1024..65535')
|
|
49
|
-
info=parse(run('showvminfo',vm,'--machinereadable'))
|
|
50
|
-
if info.get('VMState') not in ('poweroff','aborted'):
|
|
51
|
-
raise ValueError('Configure the VNC module on a powered-off VM before starting it')
|
|
52
|
-
# Per-VM selection does not change another VM's host-global VRDE module.
|
|
53
|
-
run('modifyvm',vm,'--vrdeextpack','VNC','--vrde','on','--vrdeaddress','127.0.0.1','--vrdeport',str(port))
|
|
54
|
-
return {**state,'status':'configured','vm_name':vm,'host':'127.0.0.1','port':int(port),
|
|
55
|
-
'uri':f'vnc://127.0.0.1:{port}','stream_verified':False}
|
|
56
|
-
|
|
57
|
-
if __name__=='__main__':
|
|
58
|
-
try:
|
|
59
|
-
values=json.load(sys.stdin);action=values.pop('action','probe')
|
|
60
|
-
print(json.dumps(probe() if action=='probe' else setup(**values)))
|
|
61
|
-
except Exception as error:print(json.dumps({'status':'error','error_summary':str(error)[:300]}));sys.exit(1)
|
|
1
|
+
"""Probe/install ONLY the open-source VNC extension and configure a loopback console."""
|
|
2
|
+
import hashlib
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import re
|
|
6
|
+
import sys
|
|
7
|
+
import tarfile
|
|
8
|
+
import xml.etree.ElementTree as ET
|
|
9
|
+
try:
|
|
10
|
+
from .display import command
|
|
11
|
+
from .provision import parse
|
|
12
|
+
except ImportError:
|
|
13
|
+
from display import command
|
|
14
|
+
from provision import parse
|
|
15
|
+
|
|
16
|
+
SOURCE='https://www.virtualbox.org/browser/vbox/trunk/src/VBox/ExtPacks/VNC'
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def probe(run=command):
|
|
20
|
+
version=run('--version').strip();text=run('list','extpacks')
|
|
21
|
+
blocks=re.split(r'(?m)^Pack no\.\s*\d+:',text)[1:]
|
|
22
|
+
vnc=next((block for block in blocks if block.splitlines()[0].strip()=='VNC'),None)
|
|
23
|
+
usable=bool(vnc and re.search(r'(?m)^Usable:\s*true\s*$',vnc,re.I))
|
|
24
|
+
return {'status':'available' if usable else 'module_required','backend':'virtualbox','protocol':'vnc',
|
|
25
|
+
'virtualbox_version':version,'open_source_module':'VNC','module_usable':usable,
|
|
26
|
+
'oracle_extension_pack_required':False,'source':SOURCE}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def setup(vm=None,extpack_path=None,sha256=None,allow_install=False,port=5901,run=command):
|
|
30
|
+
state=probe(run)
|
|
31
|
+
if not state['module_usable'] and extpack_path:
|
|
32
|
+
if not allow_install:return {**state,'status':'install_not_requested'}
|
|
33
|
+
source=Path(extpack_path).expanduser().resolve(strict=True)
|
|
34
|
+
if not sha256 or hashlib.file_digest(source.open('rb'),'sha256').hexdigest().casefold()!=sha256.casefold():
|
|
35
|
+
raise ValueError('Provide the verified SHA-256 of the chosen VNC extension package')
|
|
36
|
+
with tarfile.open(source,'r:*') as archive:
|
|
37
|
+
metadata=next((member for member in archive.getmembers() if member.name=='ExtPack.xml'),None)
|
|
38
|
+
if metadata is None or metadata.size>65536:raise ValueError('Invalid extension package metadata')
|
|
39
|
+
root=ET.fromstring(archive.extractfile(metadata).read())
|
|
40
|
+
if root.findtext('Name')!='VNC':raise ValueError('Only the open-source VNC extension is accepted; Oracle Extension Pack is not installed')
|
|
41
|
+
version=root.find('Version')
|
|
42
|
+
package_version=(version.text or '').strip() if version is not None else ''
|
|
43
|
+
host_version=state['virtualbox_version'].split('_')[0].split('r')[0]
|
|
44
|
+
if package_version!=host_version:raise ValueError('VNC extension version must match the host VirtualBox version')
|
|
45
|
+
run('extpack','install','--replace',str(source))
|
|
46
|
+
state=probe(run)
|
|
47
|
+
if not vm or not state['module_usable']:return state
|
|
48
|
+
if not 1024<=int(port)<=65535:raise ValueError('Use an unprivileged VNC port in 1024..65535')
|
|
49
|
+
info=parse(run('showvminfo',vm,'--machinereadable'))
|
|
50
|
+
if info.get('VMState') not in ('poweroff','aborted'):
|
|
51
|
+
raise ValueError('Configure the VNC module on a powered-off VM before starting it')
|
|
52
|
+
# Per-VM selection does not change another VM's host-global VRDE module.
|
|
53
|
+
run('modifyvm',vm,'--vrdeextpack','VNC','--vrde','on','--vrdeaddress','127.0.0.1','--vrdeport',str(port))
|
|
54
|
+
return {**state,'status':'configured','vm_name':vm,'host':'127.0.0.1','port':int(port),
|
|
55
|
+
'uri':f'vnc://127.0.0.1:{port}','stream_verified':False}
|
|
56
|
+
|
|
57
|
+
if __name__=='__main__':
|
|
58
|
+
try:
|
|
59
|
+
values=json.load(sys.stdin);action=values.pop('action','probe')
|
|
60
|
+
print(json.dumps(probe() if action=='probe' else setup(**values)))
|
|
61
|
+
except Exception as error:print(json.dumps({'status':'error','error_summary':str(error)[:300]}));sys.exit(1)
|
package/runtime/guest_keys.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"""US keyboard mappings shared by SPICE and VNC transports."""
|
|
2
|
-
SCANCODES = dict(zip('1234567890', range(2, 12)))
|
|
3
|
-
SCANCODES.update(dict(zip('qwertyuiop', range(16, 26))))
|
|
4
|
-
SCANCODES.update(dict(zip('asdfghjkl', range(30, 39))))
|
|
5
|
-
SCANCODES.update(dict(zip('zxcvbnm', range(44, 51))))
|
|
6
|
-
SCANCODES.update(enter=28, esc=1, tab=15, space=57, ctrl=29, alt=56,
|
|
7
|
-
shift=42, super=0x15b, backspace=14, f2=60, left=0x14b,
|
|
8
|
-
right=0x14d, up=0x148, down=0x150, delete=0x153,
|
|
9
|
-
**{'-':12, '=':13, '[':26, ']':27, ';':39, "'":40,
|
|
10
|
-
'`':41, '\\':43, ',':51, '.':52, '/':53, ' ':57, '\n':28})
|
|
11
|
-
SCANCODES.update({f'f{i}': 58+i for i in range(1,11)})
|
|
12
|
-
SCANCODES.update(f11=87, f12=88)
|
|
13
|
-
SHIFTED = dict(zip('!@#$%^&*()_+{}:"~|<>?', '1234567890-=[];\'`\\,./'))
|
|
1
|
+
"""US keyboard mappings shared by SPICE and VNC transports."""
|
|
2
|
+
SCANCODES = dict(zip('1234567890', range(2, 12)))
|
|
3
|
+
SCANCODES.update(dict(zip('qwertyuiop', range(16, 26))))
|
|
4
|
+
SCANCODES.update(dict(zip('asdfghjkl', range(30, 39))))
|
|
5
|
+
SCANCODES.update(dict(zip('zxcvbnm', range(44, 51))))
|
|
6
|
+
SCANCODES.update(enter=28, esc=1, tab=15, space=57, ctrl=29, alt=56,
|
|
7
|
+
shift=42, super=0x15b, backspace=14, f2=60, left=0x14b,
|
|
8
|
+
right=0x14d, up=0x148, down=0x150, delete=0x153,
|
|
9
|
+
**{'-':12, '=':13, '[':26, ']':27, ';':39, "'":40,
|
|
10
|
+
'`':41, '\\':43, ',':51, '.':52, '/':53, ' ':57, '\n':28})
|
|
11
|
+
SCANCODES.update({f'f{i}': 58+i for i in range(1,11)})
|
|
12
|
+
SCANCODES.update(f11=87, f12=88)
|
|
13
|
+
SHIFTED = dict(zip('!@#$%^&*()_+{}:"~|<>?', '1234567890-=[];\'`\\,./'))
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
d-i debian-installer/locale string en_US.UTF-8
|
|
2
|
+
d-i keyboard-configuration/xkb-keymap select us
|
|
3
|
+
d-i netcfg/choose_interface select auto
|
|
4
|
+
d-i netcfg/get_hostname string vamp-desktop
|
|
5
|
+
d-i netcfg/get_domain string local
|
|
6
|
+
d-i mirror/country string manual
|
|
7
|
+
d-i mirror/http/hostname string deb.debian.org
|
|
8
|
+
d-i mirror/http/directory string /debian
|
|
9
|
+
d-i mirror/http/proxy string
|
|
10
|
+
d-i passwd/root-login boolean false
|
|
11
|
+
d-i passwd/user-fullname string VAMP Sandbox
|
|
12
|
+
d-i passwd/username string vboxuser
|
|
13
|
+
d-i clock-setup/utc boolean true
|
|
14
|
+
d-i time/zone string Asia/Seoul
|
|
15
|
+
d-i clock-setup/ntp boolean false
|
|
16
|
+
d-i partman-auto/method string regular
|
|
17
|
+
d-i partman-auto/choose_recipe select atomic
|
|
18
|
+
d-i partman-partitioning/confirm_write_new_label boolean true
|
|
19
|
+
d-i partman/choose_partition select finish
|
|
20
|
+
d-i partman/confirm boolean true
|
|
21
|
+
d-i partman/confirm_nooverwrite boolean true
|
|
22
|
+
d-i apt-setup/cdrom/set-first boolean false
|
|
23
|
+
d-i apt-setup/disable-cdrom-entries boolean true
|
|
24
|
+
d-i apt-setup/use_mirror boolean true
|
|
25
|
+
d-i apt-setup/another-cd boolean false
|
|
26
|
+
d-i pkgsel/run_tasksel boolean false
|
|
27
|
+
d-i pkgsel/include string sudo python3 curl wget task-gnome-desktop gdm3 xorg gnome-session-xsession dbus-x11
|
|
28
|
+
d-i pkgsel/upgrade select none
|
|
29
|
+
popularity-contest popularity-contest/participate boolean false
|
|
30
|
+
d-i grub-installer/only_debian boolean true
|
|
31
|
+
d-i grub-installer/bootdev string default
|
|
32
|
+
d-i finish-install/reboot_in_progress note
|
|
33
|
+
d-i cdrom-detect/eject boolean true
|
|
34
|
+
d-i passwd/user-default-groups string sudo
|
|
35
|
+
tasksel tasksel/first multiselect standard, desktop, gnome-desktop
|
|
36
|
+
shared shared/default-x-display-manager select gdm3
|
|
37
|
+
d-i passwd/user-password password password123!
|
|
38
|
+
d-i passwd/user-password-again password password123!
|
|
39
|
+
d-i preseed/late_command string base=$(sed -n 's/.*vamp_base=\([^ ]*\).*/\1/p' /proc/cmdline); wget -qO /tmp/vamp-postdeb.sh "$base/postdeb.sh" && VAMP_SCRIPT_BASE_URL="$base" sh /tmp/vamp-postdeb.sh
|
|
@@ -38,10 +38,57 @@ export DEBIAN_FRONTEND=noninteractive
|
|
|
38
38
|
python3 /opt/rpa-recorder-setup/recorder/configure-debian-mirrors.py
|
|
39
39
|
apt-get update
|
|
40
40
|
apt-get install -y build-essential python3-venv python3-tk python3-dev python3-dbus x11-xserver-utils xdg-user-dirs scrot task-gnome-desktop xorg gnome-session-xsession
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
python3 /opt/rpa-recorder-setup/recorder/configure-gdm.py
|
|
42
|
+
# Debian 13 uses a static gdm.service; enabling gdm3 alone does not create
|
|
43
|
+
# display-manager.service when tasksel was skipped by the unattended installer.
|
|
44
|
+
gdm_unit=
|
|
45
|
+
for candidate in /usr/lib/systemd/system/gdm.service /usr/lib/systemd/system/gdm3.service /lib/systemd/system/gdm3.service; do
|
|
46
|
+
if [ -f "$candidate" ]; then gdm_unit=$candidate; break; fi
|
|
47
|
+
done
|
|
48
|
+
[ -n "$gdm_unit" ]
|
|
49
|
+
ln -sf "$gdm_unit" /etc/systemd/system/display-manager.service
|
|
50
|
+
systemctl set-default graphical.target
|
|
44
51
|
user_home=$(getent passwd vboxuser | cut -d: -f6)
|
|
45
52
|
[ -n "$user_home" ]
|
|
46
53
|
/usr/sbin/runuser -u vboxuser -- env HOME="$user_home" RPA_DEPS_READY=1 sh /opt/rpa-recorder-setup/recorder/setup.sh
|
|
47
54
|
'
|
|
55
|
+
|
|
56
|
+
# Written only after the target user recorder setup exits successfully.
|
|
57
|
+
mkdir -p "$target/var/lib/vamp"
|
|
58
|
+
touch "$target/var/lib/vamp/guest-setup.complete"
|
|
59
|
+
|
|
60
|
+
# Packer waits through the first reboot, then finalizes in the auto-login desktop.
|
|
61
|
+
if [ -n "${VAMP_PACKER_CALLBACK:-}" ]; then
|
|
62
|
+
printf '%s\n' "$VAMP_PACKER_CALLBACK" > "$target/var/lib/vamp/packer-callback"
|
|
63
|
+
cat > "$target/usr/local/sbin/vamp-packer-finalize" <<'FINALIZE'
|
|
64
|
+
#!/bin/sh
|
|
65
|
+
set -eu
|
|
66
|
+
sleep 60
|
|
67
|
+
uid=$(id -u vboxuser)
|
|
68
|
+
user_home=$(getent passwd vboxuser | cut -d: -f6)
|
|
69
|
+
test -S "/run/user/$uid/bus"
|
|
70
|
+
/usr/sbin/runuser -u vboxuser -- env HOME="$user_home" XDG_RUNTIME_DIR="/run/user/$uid" DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" DISPLAY=:0 RPA_DEPS_READY=1 sh /opt/rpa-recorder-setup/recorder/setup.sh
|
|
71
|
+
touch /var/lib/vamp/packer-postinstall.complete
|
|
72
|
+
callback=$(cat /var/lib/vamp/packer-callback)
|
|
73
|
+
curl --fail --retry 10 --retry-delay 5 -X POST "$callback"
|
|
74
|
+
systemctl disable vamp-packer-finalize.service
|
|
75
|
+
rm -f /var/lib/vamp/packer-callback
|
|
76
|
+
shutdown -h now
|
|
77
|
+
FINALIZE
|
|
78
|
+
chmod 755 "$target/usr/local/sbin/vamp-packer-finalize"
|
|
79
|
+
cat > "$target/etc/systemd/system/vamp-packer-finalize.service" <<'SERVICE'
|
|
80
|
+
[Unit]
|
|
81
|
+
Description=VAMP Packer post-login setup (60 second desktop wait)
|
|
82
|
+
After=graphical.target network-online.target
|
|
83
|
+
Wants=network-online.target
|
|
84
|
+
[Service]
|
|
85
|
+
Type=oneshot
|
|
86
|
+
ExecStart=/usr/local/sbin/vamp-packer-finalize
|
|
87
|
+
TimeoutStartSec=3600
|
|
88
|
+
Restart=on-failure
|
|
89
|
+
RestartSec=15
|
|
90
|
+
[Install]
|
|
91
|
+
WantedBy=graphical.target
|
|
92
|
+
SERVICE
|
|
93
|
+
chroot "$target" systemctl enable vamp-packer-finalize.service
|
|
94
|
+
fi
|
|
@@ -1,28 +1,53 @@
|
|
|
1
|
-
# VAMP Windows postinstall, run at the first desktop login of the unattended account.
|
|
2
|
-
# It
|
|
3
|
-
$ErrorActionPreference = 'Stop'
|
|
4
|
-
$
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
$
|
|
28
|
-
|
|
1
|
+
# VAMP Windows postinstall, run at the first desktop login of the unattended account.
|
|
2
|
+
# It downloads and executes setup immediately in that user's session.
|
|
3
|
+
$ErrorActionPreference = 'Stop'
|
|
4
|
+
$principal=New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
|
5
|
+
if(-not $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)){
|
|
6
|
+
$payload='Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force; '
|
|
7
|
+
if($PSCommandPath){$payload+="& '"+$PSCommandPath.Replace("'","''")+"'"}
|
|
8
|
+
else {
|
|
9
|
+
$origin=if($env:VAMP_SCRIPT_BASE_URL){$env:VAMP_SCRIPT_BASE_URL}else{'http://10.0.2.2:8421'}
|
|
10
|
+
$payload+="irm '"+($origin+'/postwin.ps1').Replace("'","''")+"' | iex"
|
|
11
|
+
}
|
|
12
|
+
$encoded=[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($payload))
|
|
13
|
+
$elevated=Start-Process powershell.exe -Verb RunAs -ArgumentList @('-NoProfile','-ExecutionPolicy','Unrestricted','-EncodedCommand',$encoded) -Wait -PassThru
|
|
14
|
+
if($elevated.ExitCode -ne 0){throw 'Administrator setup did not complete successfully'}
|
|
15
|
+
return
|
|
16
|
+
}
|
|
17
|
+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force
|
|
18
|
+
|
|
19
|
+
$base = if ($env:VAMP_SCRIPT_BASE_URL) { $env:VAMP_SCRIPT_BASE_URL } else { 'http://10.0.2.2:8421' }
|
|
20
|
+
$target = Join-Path $env:ProgramData 'RPA-Recorder-Setup'
|
|
21
|
+
New-Item -ItemType Directory -Force -Path $target | Out-Null
|
|
22
|
+
$zip = Join-Path $env:TEMP 'vamp-guest-setup.zip'
|
|
23
|
+
$downloaded = $false
|
|
24
|
+
for ($attempt = 1; $attempt -le 15; $attempt++) {
|
|
25
|
+
try {
|
|
26
|
+
Invoke-WebRequest -UseBasicParsing -Uri "$base/vamp-guest-setup.zip" -OutFile $zip -TimeoutSec 30
|
|
27
|
+
$downloaded = $true
|
|
28
|
+
break
|
|
29
|
+
} catch {
|
|
30
|
+
if ($attempt -eq 15) {
|
|
31
|
+
throw "VAMP: cannot download $base/vamp-guest-setup.zip during postinstall. Start the host script server on port 8421. $_"
|
|
32
|
+
}
|
|
33
|
+
Start-Sleep -Seconds 8
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (-not $downloaded) { throw 'VAMP: setup bundle download failed' }
|
|
37
|
+
Expand-Archive -LiteralPath $zip -DestinationPath $target -Force
|
|
38
|
+
|
|
39
|
+
# Execute in this first desktop session rather than waiting for another login.
|
|
40
|
+
$log = Join-Path $target 'postinstall.log'
|
|
41
|
+
Start-Transcript -Path $log -Append
|
|
42
|
+
try {
|
|
43
|
+
& (Join-Path $target 'recorder\setup.ps1')
|
|
44
|
+
if (-not $?) { throw 'VAMP recorder setup failed' }
|
|
45
|
+
@{status='completed';user=$env:USERNAME;completed_at=(Get-Date).ToString('o')} |
|
|
46
|
+
ConvertTo-Json | Set-Content -Encoding UTF8 -LiteralPath (Join-Path $target 'postinstall-result.json')
|
|
47
|
+
} catch {
|
|
48
|
+
@{status='failed';user=$env:USERNAME;error=$_.Exception.Message} |
|
|
49
|
+
ConvertTo-Json | Set-Content -Encoding UTF8 -LiteralPath (Join-Path $target 'postinstall-result.json')
|
|
50
|
+
throw
|
|
51
|
+
} finally {
|
|
52
|
+
Stop-Transcript
|
|
53
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# VAMP full guest setup bootstrap (recorder + vault), served by the host script server on port 8421.
|
|
2
|
-
#
|
|
3
|
-
# powershell -ExecutionPolicy Bypass -Command "irm http://10.0.2.2:8421/setup-all.ps1 | iex"
|
|
4
|
-
$ErrorActionPreference = 'Stop'
|
|
5
|
-
$base = if ($env:VAMP_SCRIPT_BASE_URL) { $env:VAMP_SCRIPT_BASE_URL } else { 'http://10.0.2.2:8421' }
|
|
6
|
-
$work = Join-Path $env:TEMP 'vamp-guest-setup'
|
|
7
|
-
if (Test-Path -LiteralPath $work) { Remove-Item -LiteralPath $work -Recurse -Force }
|
|
8
|
-
New-Item -ItemType Directory -Force -Path $work | Out-Null
|
|
9
|
-
$zip = Join-Path $work 'vamp-guest-setup.zip'
|
|
10
|
-
$downloaded = $false
|
|
11
|
-
for ($attempt = 1; $attempt -le 10; $attempt++) {
|
|
12
|
-
try {
|
|
13
|
-
Invoke-WebRequest -UseBasicParsing -Uri "$base/vamp-guest-setup.zip" -OutFile $zip -TimeoutSec 30
|
|
14
|
-
$downloaded = $true
|
|
15
|
-
break
|
|
16
|
-
} catch {
|
|
17
|
-
if ($attempt -eq 10) {
|
|
18
|
-
throw "VAMP: cannot download $base/vamp-guest-setup.zip. Start the host script server on port 8421 and retry. $_"
|
|
19
|
-
}
|
|
20
|
-
Start-Sleep -Seconds 6
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (-not $downloaded) { throw 'VAMP: setup bundle download failed' }
|
|
24
|
-
Expand-Archive -LiteralPath $zip -DestinationPath $work -Force
|
|
25
|
-
& (Join-Path $work 'setup-all.ps1')
|
|
1
|
+
# VAMP full guest setup bootstrap (recorder + vault), served by the host script server on port 8421.
|
|
2
|
+
#
|
|
3
|
+
# powershell -ExecutionPolicy Bypass -Command "irm http://10.0.2.2:8421/setup-all.ps1 | iex"
|
|
4
|
+
$ErrorActionPreference = 'Stop'
|
|
5
|
+
$base = if ($env:VAMP_SCRIPT_BASE_URL) { $env:VAMP_SCRIPT_BASE_URL } else { 'http://10.0.2.2:8421' }
|
|
6
|
+
$work = Join-Path $env:TEMP 'vamp-guest-setup'
|
|
7
|
+
if (Test-Path -LiteralPath $work) { Remove-Item -LiteralPath $work -Recurse -Force }
|
|
8
|
+
New-Item -ItemType Directory -Force -Path $work | Out-Null
|
|
9
|
+
$zip = Join-Path $work 'vamp-guest-setup.zip'
|
|
10
|
+
$downloaded = $false
|
|
11
|
+
for ($attempt = 1; $attempt -le 10; $attempt++) {
|
|
12
|
+
try {
|
|
13
|
+
Invoke-WebRequest -UseBasicParsing -Uri "$base/vamp-guest-setup.zip" -OutFile $zip -TimeoutSec 30
|
|
14
|
+
$downloaded = $true
|
|
15
|
+
break
|
|
16
|
+
} catch {
|
|
17
|
+
if ($attempt -eq 10) {
|
|
18
|
+
throw "VAMP: cannot download $base/vamp-guest-setup.zip. Start the host script server on port 8421 and retry. $_"
|
|
19
|
+
}
|
|
20
|
+
Start-Sleep -Seconds 6
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (-not $downloaded) { throw 'VAMP: setup bundle download failed' }
|
|
24
|
+
Expand-Archive -LiteralPath $zip -DestinationPath $work -Force
|
|
25
|
+
& (Join-Path $work 'setup-all.ps1')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
rem VAMP guest setup bootstrap for cmd.exe, served by the host script server on port 8421.
|
|
3
|
-
rem curl.exe -fsSL http://10.0.2.2:8421/setup-win.cmd -o "%TEMP%\setup-win.cmd" && "%TEMP%\setup-win.cmd"
|
|
4
|
-
setlocal
|
|
5
|
-
if "%VAMP_SCRIPT_BASE_URL%"=="" set "VAMP_SCRIPT_BASE_URL=http://10.0.2.2:8421"
|
|
6
|
-
powershell -NoProfile -ExecutionPolicy
|
|
7
|
-
exit /b %errorlevel%
|
|
1
|
+
@echo off
|
|
2
|
+
rem VAMP guest setup bootstrap for cmd.exe, served by the host script server on port 8421.
|
|
3
|
+
rem curl.exe -fsSL http://10.0.2.2:8421/setup-win.cmd -o "%TEMP%\setup-win.cmd" && "%TEMP%\setup-win.cmd"
|
|
4
|
+
setlocal
|
|
5
|
+
if "%VAMP_SCRIPT_BASE_URL%"=="" set "VAMP_SCRIPT_BASE_URL=http://10.0.2.2:8421"
|
|
6
|
+
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "irm %VAMP_SCRIPT_BASE_URL%/setup.ps1 | iex"
|
|
7
|
+
exit /b %errorlevel%
|
|
@@ -1,29 +1,44 @@
|
|
|
1
|
-
# VAMP guest setup bootstrap (Windows), served by the host script server on port 8421.
|
|
2
|
-
#
|
|
3
|
-
# In the guest (VirtualBox NAT uses 10.0.2.2 for the host):
|
|
4
|
-
# powershell -ExecutionPolicy
|
|
5
|
-
# curl.exe -fsSL http://10.0.2.2:8421/setup-win.cmd -o %TEMP%\setup-win.cmd && %TEMP%\setup-win.cmd
|
|
6
|
-
#
|
|
7
|
-
# Runs in the desktop user's session; setup.ps1 installs Python for the current user.
|
|
8
|
-
$ErrorActionPreference = 'Stop'
|
|
9
|
-
$
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
$
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
# VAMP guest setup bootstrap (Windows), served by the host script server on port 8421.
|
|
2
|
+
#
|
|
3
|
+
# In the guest (VirtualBox NAT uses 10.0.2.2 for the host):
|
|
4
|
+
# powershell -ExecutionPolicy Unrestricted -Command "irm http://10.0.2.2:8421/setup.ps1 | iex"
|
|
5
|
+
# curl.exe -fsSL http://10.0.2.2:8421/setup-win.cmd -o %TEMP%\setup-win.cmd && %TEMP%\setup-win.cmd
|
|
6
|
+
#
|
|
7
|
+
# Runs in the desktop user's session; setup.ps1 installs Python for the current user.
|
|
8
|
+
$ErrorActionPreference = 'Stop'
|
|
9
|
+
$principal=New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
|
10
|
+
if(-not $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)){
|
|
11
|
+
$payload='Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force; '
|
|
12
|
+
if($PSCommandPath){$payload+="& '"+$PSCommandPath.Replace("'","''")+"'"}
|
|
13
|
+
else {
|
|
14
|
+
$origin=if($env:VAMP_SCRIPT_BASE_URL){$env:VAMP_SCRIPT_BASE_URL}else{'http://10.0.2.2:8421'}
|
|
15
|
+
$payload+="irm '"+($origin+'/setup.ps1').Replace("'","''")+"' | iex"
|
|
16
|
+
}
|
|
17
|
+
$encoded=[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($payload))
|
|
18
|
+
$elevated=Start-Process powershell.exe -Verb RunAs -ArgumentList @('-NoProfile','-ExecutionPolicy','Unrestricted','-EncodedCommand',$encoded) -Wait -PassThru
|
|
19
|
+
if($elevated.ExitCode -ne 0){throw 'Administrator setup did not complete successfully'}
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force
|
|
23
|
+
|
|
24
|
+
$base = if ($env:VAMP_SCRIPT_BASE_URL) { $env:VAMP_SCRIPT_BASE_URL } else { 'http://10.0.2.2:8421' }
|
|
25
|
+
$work = Join-Path $env:TEMP 'vamp-guest-setup'
|
|
26
|
+
if (Test-Path -LiteralPath $work) { Remove-Item -LiteralPath $work -Recurse -Force }
|
|
27
|
+
New-Item -ItemType Directory -Force -Path $work | Out-Null
|
|
28
|
+
$zip = Join-Path $work 'vamp-guest-setup.zip'
|
|
29
|
+
$downloaded = $false
|
|
30
|
+
for ($attempt = 1; $attempt -le 10; $attempt++) {
|
|
31
|
+
try {
|
|
32
|
+
Invoke-WebRequest -UseBasicParsing -Uri "$base/vamp-guest-setup.zip" -OutFile $zip -TimeoutSec 30
|
|
33
|
+
$downloaded = $true
|
|
34
|
+
break
|
|
35
|
+
} catch {
|
|
36
|
+
if ($attempt -eq 10) {
|
|
37
|
+
throw "VAMP: cannot download $base/vamp-guest-setup.zip. Start the host script server on port 8421 and retry. $_"
|
|
38
|
+
}
|
|
39
|
+
Start-Sleep -Seconds 6
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (-not $downloaded) { throw 'VAMP: setup bundle download failed' }
|
|
43
|
+
Expand-Archive -LiteralPath $zip -DestinationPath $work -Force
|
|
44
|
+
& (Join-Path $work 'recorder/setup.ps1')
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
# Runs once as the test desktop administrator after unattended Windows install.
|
|
2
|
-
$ErrorActionPreference = 'Stop'
|
|
3
|
-
$root = 'C:\ProgramData\VAMP-Setup'
|
|
4
|
-
New-Item -ItemType Directory -Force -Path $root | Out-Null
|
|
5
|
-
Start-Transcript -Path (Join-Path $root 'setup.log') -Append
|
|
6
|
-
function Uart([string]$Message) {
|
|
7
|
-
try {
|
|
8
|
-
$port = [System.IO.Ports.SerialPort]::new('COM1',115200,[System.IO.Ports.Parity]::None,8,[System.IO.Ports.StopBits]::One)
|
|
9
|
-
$port.Open(); $port.WriteLine($Message); $port.Close()
|
|
10
|
-
} catch { Write-Warning "UART report unavailable: $_" }
|
|
11
|
-
}
|
|
12
|
-
function Run-Installer([string]$File, [string]$Arguments) {
|
|
13
|
-
$process = Start-Process -FilePath $File -ArgumentList $Arguments -Wait -PassThru
|
|
14
|
-
if ($process.ExitCode -notin @(0,3010)) { throw "Installer exited with $($process.ExitCode): $File" }
|
|
15
|
-
}
|
|
16
|
-
try {
|
|
17
|
-
@{status='running'} | ConvertTo-Json | Set-Content (Join-Path $root 'result.json')
|
|
18
|
-
$manifest = Get-Content -Raw (Join-Path $root 'installers\manifest.json') | ConvertFrom-Json
|
|
19
|
-
foreach ($name in @('python','keepassxc','veracrypt','virtio','vcredist')) {
|
|
20
|
-
$info = $manifest.$name
|
|
21
|
-
$file = Join-Path $root ('installers\'+[IO.Path]::GetFileName($info.path))
|
|
22
|
-
if ((Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash.ToLowerInvariant() -ne $info.sha256) { throw "Checksum mismatch: $name" }
|
|
23
|
-
}
|
|
24
|
-
$vcRuntime = & (Join-Path $root 'vault\Install-VCRuntime.ps1') -InstallerPath (Join-Path $root 'installers\vcredist.exe') -ExpectedSha256 $manifest.vcredist.sha256
|
|
25
|
-
if (-not (Get-Service -Name 'qemu-ga' -ErrorAction SilentlyContinue)) {
|
|
26
|
-
Run-Installer (Join-Path $root 'installers\virtio.exe') '/quiet /norestart'
|
|
27
|
-
}
|
|
28
|
-
$python = 'C:\ProgramData\VAMP\Python312\python.exe'
|
|
29
|
-
if (-not (Test-Path $python)) {
|
|
30
|
-
Run-Installer (Join-Path $root 'installers\python.exe') '/quiet InstallAllUsers=1 TargetDir=C:\ProgramData\VAMP\Python312 Include_test=0 Include_launcher=0 PrependPath=0'
|
|
31
|
-
}
|
|
32
|
-
if (-not (Test-Path 'C:\Program Files\KeePassXC\keepassxc-proxy.exe')) {
|
|
33
|
-
Run-Installer 'msiexec.exe' ('/i "'+$root+'\installers\keepassxc.msi" /qn /norestart /L*v "'+$root+'\keepassxc-install.log"')
|
|
34
|
-
}
|
|
35
|
-
if (-not (Test-Path 'C:\Program Files\VeraCrypt\VeraCrypt.exe')) {
|
|
36
|
-
Run-Installer 'msiexec.exe' ('/i "'+$root+'\installers\veracrypt.msi" /qn /norestart ACCEPTLICENSE=YES /L*v "'+$root+'\veracrypt-install.log"')
|
|
37
|
-
}
|
|
38
|
-
& $python (Join-Path $root 'recorder\setup-user.py')
|
|
39
|
-
if ($LASTEXITCODE -ne 0) { throw "Recorder setup failed: $LASTEXITCODE" }
|
|
40
|
-
& (Join-Path $root 'vault\setup-guest-vault.ps1')
|
|
41
|
-
$recorderPython = Join-Path ([Environment]::GetFolderPath('Desktop')) 'RPA-Recorder\.venv\Scripts\python.exe'
|
|
42
|
-
& $recorderPython (Join-Path $root 'recorder\verify-recorder.py')
|
|
43
|
-
if ($LASTEXITCODE -ne 0) { throw 'Recorder dependency verification failed' }
|
|
44
|
-
$result = @{status='configured';python=$python;recorder_python=$recorderPython;keepassxc_proxy='C:\Program Files\KeePassXC\keepassxc-proxy.exe';veracrypt='C:\Program Files\VeraCrypt\VeraCrypt.exe';passkey_login_verified=$false}
|
|
45
|
-
$result | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $root 'result.json') -Encoding utf8
|
|
46
|
-
Uart 'VAMP-WINDOWS-SETUP-CONFIGURED'
|
|
47
|
-
Write-Output 'VAMP-WINDOWS-SETUP-CONFIGURED'
|
|
48
|
-
} catch {
|
|
49
|
-
@{status='failed';error=$_.Exception.Message} | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $root 'result.json') -Encoding utf8
|
|
50
|
-
Uart 'VAMP-WINDOWS-SETUP-FAILED'
|
|
51
|
-
throw
|
|
52
|
-
} finally { Stop-Transcript }
|
|
1
|
+
# Runs once as the test desktop administrator after unattended Windows install.
|
|
2
|
+
$ErrorActionPreference = 'Stop'
|
|
3
|
+
$root = 'C:\ProgramData\VAMP-Setup'
|
|
4
|
+
New-Item -ItemType Directory -Force -Path $root | Out-Null
|
|
5
|
+
Start-Transcript -Path (Join-Path $root 'setup.log') -Append
|
|
6
|
+
function Uart([string]$Message) {
|
|
7
|
+
try {
|
|
8
|
+
$port = [System.IO.Ports.SerialPort]::new('COM1',115200,[System.IO.Ports.Parity]::None,8,[System.IO.Ports.StopBits]::One)
|
|
9
|
+
$port.Open(); $port.WriteLine($Message); $port.Close()
|
|
10
|
+
} catch { Write-Warning "UART report unavailable: $_" }
|
|
11
|
+
}
|
|
12
|
+
function Run-Installer([string]$File, [string]$Arguments) {
|
|
13
|
+
$process = Start-Process -FilePath $File -ArgumentList $Arguments -Wait -PassThru
|
|
14
|
+
if ($process.ExitCode -notin @(0,3010)) { throw "Installer exited with $($process.ExitCode): $File" }
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
@{status='running'} | ConvertTo-Json | Set-Content (Join-Path $root 'result.json')
|
|
18
|
+
$manifest = Get-Content -Raw (Join-Path $root 'installers\manifest.json') | ConvertFrom-Json
|
|
19
|
+
foreach ($name in @('python','keepassxc','veracrypt','virtio','vcredist')) {
|
|
20
|
+
$info = $manifest.$name
|
|
21
|
+
$file = Join-Path $root ('installers\'+[IO.Path]::GetFileName($info.path))
|
|
22
|
+
if ((Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash.ToLowerInvariant() -ne $info.sha256) { throw "Checksum mismatch: $name" }
|
|
23
|
+
}
|
|
24
|
+
$vcRuntime = & (Join-Path $root 'vault\Install-VCRuntime.ps1') -InstallerPath (Join-Path $root 'installers\vcredist.exe') -ExpectedSha256 $manifest.vcredist.sha256
|
|
25
|
+
if (-not (Get-Service -Name 'qemu-ga' -ErrorAction SilentlyContinue)) {
|
|
26
|
+
Run-Installer (Join-Path $root 'installers\virtio.exe') '/quiet /norestart'
|
|
27
|
+
}
|
|
28
|
+
$python = 'C:\ProgramData\VAMP\Python312\python.exe'
|
|
29
|
+
if (-not (Test-Path $python)) {
|
|
30
|
+
Run-Installer (Join-Path $root 'installers\python.exe') '/quiet InstallAllUsers=1 TargetDir=C:\ProgramData\VAMP\Python312 Include_test=0 Include_launcher=0 PrependPath=0'
|
|
31
|
+
}
|
|
32
|
+
if (-not (Test-Path 'C:\Program Files\KeePassXC\keepassxc-proxy.exe')) {
|
|
33
|
+
Run-Installer 'msiexec.exe' ('/i "'+$root+'\installers\keepassxc.msi" /qn /norestart /L*v "'+$root+'\keepassxc-install.log"')
|
|
34
|
+
}
|
|
35
|
+
if (-not (Test-Path 'C:\Program Files\VeraCrypt\VeraCrypt.exe')) {
|
|
36
|
+
Run-Installer 'msiexec.exe' ('/i "'+$root+'\installers\veracrypt.msi" /qn /norestart ACCEPTLICENSE=YES /L*v "'+$root+'\veracrypt-install.log"')
|
|
37
|
+
}
|
|
38
|
+
& $python (Join-Path $root 'recorder\setup-user.py')
|
|
39
|
+
if ($LASTEXITCODE -ne 0) { throw "Recorder setup failed: $LASTEXITCODE" }
|
|
40
|
+
& (Join-Path $root 'vault\setup-guest-vault.ps1')
|
|
41
|
+
$recorderPython = Join-Path ([Environment]::GetFolderPath('Desktop')) 'RPA-Recorder\.venv\Scripts\python.exe'
|
|
42
|
+
& $recorderPython (Join-Path $root 'recorder\verify-recorder.py')
|
|
43
|
+
if ($LASTEXITCODE -ne 0) { throw 'Recorder dependency verification failed' }
|
|
44
|
+
$result = @{status='configured';python=$python;recorder_python=$recorderPython;keepassxc_proxy='C:\Program Files\KeePassXC\keepassxc-proxy.exe';veracrypt='C:\Program Files\VeraCrypt\VeraCrypt.exe';passkey_login_verified=$false}
|
|
45
|
+
$result | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $root 'result.json') -Encoding utf8
|
|
46
|
+
Uart 'VAMP-WINDOWS-SETUP-CONFIGURED'
|
|
47
|
+
Write-Output 'VAMP-WINDOWS-SETUP-CONFIGURED'
|
|
48
|
+
} catch {
|
|
49
|
+
@{status='failed';error=$_.Exception.Message} | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $root 'result.json') -Encoding utf8
|
|
50
|
+
Uart 'VAMP-WINDOWS-SETUP-FAILED'
|
|
51
|
+
throw
|
|
52
|
+
} finally { Stop-Transcript }
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
Run inside the VM desktop user's session, not the host.
|
|
2
|
-
Windows: run setup-win.cmd from the mounted media in the guest user session
|
|
3
|
-
Debian X11: sh /path/to/mounted/media/setup.sh
|
|
4
|
-
Creates Desktop/RPA-Recorder, venv, launcher and recordings folder.
|
|
5
|
-
Recorder: axel-magard/PyAutoGUI-Recorder, GPL-3.0; LICENSE and source are in recorder.zip.
|
|
6
|
-
recorder.zip is committed here so setup runs without the third_party sources; the guest
|
|
7
|
-
scripts download it from the vamp-mcp GitHub repository when it is not beside them.
|
|
8
|
-
Regenerate it after changing third_party/pyautogui-recorder:
|
|
9
|
-
python3 scripts/build_recorder_zip.py
|
|
10
|
-
Use Record -> Stop -> Download and save a Python file in recordings/.
|
|
11
|
-
Do not record private credentials. Export to host, then use scripts/convert_recording.py.
|
|
12
|
-
This installer is untested in the target guests. It does not start recording automatically.
|
|
1
|
+
Run inside the VM desktop user's session, not the host.
|
|
2
|
+
Windows: run setup-win.cmd from the mounted media in the guest user session
|
|
3
|
+
Debian X11: sh /path/to/mounted/media/setup.sh
|
|
4
|
+
Creates Desktop/RPA-Recorder, venv, launcher and recordings folder.
|
|
5
|
+
Recorder: axel-magard/PyAutoGUI-Recorder, GPL-3.0; LICENSE and source are in recorder.zip.
|
|
6
|
+
recorder.zip is committed here so setup runs without the third_party sources; the guest
|
|
7
|
+
scripts download it from the vamp-mcp GitHub repository when it is not beside them.
|
|
8
|
+
Regenerate it after changing third_party/pyautogui-recorder:
|
|
9
|
+
python3 scripts/build_recorder_zip.py
|
|
10
|
+
Use Record -> Stop -> Download and save a Python file in recordings/.
|
|
11
|
+
Do not record private credentials. Export to host, then use scripts/convert_recording.py.
|
|
12
|
+
This installer is untested in the target guests. It does not start recording automatically.
|