1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!--
|
---|
3 | #
|
---|
4 | # Copyright (C) 2008-2022 Oracle Corporation
|
---|
5 | #
|
---|
6 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
7 | # available from http://www.virtualbox.org. This file is free software;
|
---|
8 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
9 | # General Public License (GPL) as published by the Free Software
|
---|
10 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
11 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
12 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
13 | #
|
---|
14 | -->
|
---|
15 | <installer-gui-script minSpecVersion="1.0">
|
---|
16 | <title>VirtualBox_title</title>
|
---|
17 | <options customize="allow" rootVolumeOnly="true" hostArchitectures="@VBOX_ARCH_LIST@"/>
|
---|
18 | <installation-check script="checkPrerequisite()"></installation-check>
|
---|
19 | <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
|
---|
20 | <script>
|
---|
21 | //<![CDATA[
|
---|
22 | /* js:pkmk:start */
|
---|
23 | function checkPrerequisite()
|
---|
24 | {
|
---|
25 | try
|
---|
26 | {
|
---|
27 | test = system.version['ProductVersion'];
|
---|
28 | system.log("OS version detected: " + test);
|
---|
29 | result = (system.compareVersions(test, '10.9') >= 0);
|
---|
30 | } catch (e) { system.log(e); result = false; }
|
---|
31 |
|
---|
32 | if (!result)
|
---|
33 | {
|
---|
34 | my.result.type = 'Fatal';
|
---|
35 | my.result.title = system.localizedString('UNSUPPORTED_OS_TLE');
|
---|
36 | my.result.message = system.localizedString('UNSUPPORTED_OS_MSG');
|
---|
37 | return result;
|
---|
38 | }
|
---|
39 |
|
---|
40 | try
|
---|
41 | {
|
---|
42 | test = system.sysctl('hw.machine');
|
---|
43 | system.log("Hardware architecture detected: " + test);
|
---|
44 | result = (test == '@VBOX_TARGET_ARCH@');
|
---|
45 | } catch (e) { system.log(e); result = false; }
|
---|
46 |
|
---|
47 | if (!result)
|
---|
48 | {
|
---|
49 | my.result.type = 'Fatal';
|
---|
50 | my.result.title = system.localizedString('UNSUPPORTED_HW_MACHINE_TLE');
|
---|
51 | my.result.message = system.localizedString('UNSUPPORTED_HW_MACHINE_MSG');
|
---|
52 | return result;
|
---|
53 | }
|
---|
54 |
|
---|
55 | try
|
---|
56 | {
|
---|
57 | /* Embedded scripts are not available here. Instead, run command to check for running VMs or running VBOX instance */
|
---|
58 | runAppArr = system.applications.all()
|
---|
59 | for (let i = 0; i < runAppArr.length; i++)
|
---|
60 | {
|
---|
61 | if (runAppArr[i]["FileCreator"] == "VBOX" || runAppArr[i]["FileCreator"] == "VBVM")
|
---|
62 | {
|
---|
63 | result = false;
|
---|
64 | }
|
---|
65 | }
|
---|
66 | system.log("system.applications check => result=" + result);
|
---|
67 | } catch (e) { system.log(e); result = false; }
|
---|
68 |
|
---|
69 | if (!result)
|
---|
70 | {
|
---|
71 |
|
---|
72 | my.result.type = 'Fatal';
|
---|
73 | my.result.title = system.localizedString('RUNNING_VMS_TLE');
|
---|
74 | my.result.message = system.localizedString('RUNNING_VMS_MSG');
|
---|
75 | return result;
|
---|
76 | }
|
---|
77 |
|
---|
78 | system.log("result:" + result);
|
---|
79 | return result;
|
---|
80 | }
|
---|
81 | /* js:pkmk:end */
|
---|
82 | //]]>
|
---|
83 | </script>
|
---|
84 | <background file="background.tif" alignment="topleft" scaling="none"/>
|
---|
85 | <welcome file="Welcome.rtf" mime-type="text/rtf" uti="public.rtf"/>
|
---|
86 | <choices-outline>
|
---|
87 | <line choice="choiceVBox"></line>
|
---|
88 | <line choice="choiceVBoxCLI"></line>
|
---|
89 | </choices-outline>
|
---|
90 | <choice id="choiceVBox" title="choiceVBox_title" description="choiceVBox_msg" start_selected="true" start_enabled="false" start_visible="true">
|
---|
91 | <pkg-ref id="org.virtualbox.pkg.virtualbox"></pkg-ref>
|
---|
92 | </choice>
|
---|
93 | <choice id="choiceVBoxCLI" title="choiceVBoxCLI_title" description="choiceVBoxCLI_msg" start_selected="true" start_enabled="true" start_visible="true">
|
---|
94 | <pkg-ref id="org.virtualbox.pkg.virtualboxcli"></pkg-ref>
|
---|
95 | </choice>
|
---|
96 | <pkg-ref id="org.virtualbox.pkg.virtualbox" auth="Root">file:./Contents/Packages/VirtualBox.pkg</pkg-ref>
|
---|
97 | <pkg-ref id="org.virtualbox.pkg.virtualboxcli" auth="Root">file:./Contents/Packages/VirtualBoxCLI.pkg</pkg-ref>
|
---|
98 | </installer-gui-script>
|
---|
99 |
|
---|