ZealOS/docs/Misc/OSInstall.CC.html
2021-10-27 03:28:16 -04:00

462 lines
48 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V1.04">
<style type="text/css">
body {background-color:#1f1f1f;}
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
.cF1{color:#4f84a6;background-color:#1f1f1f;}
.cF2{color:#73a255;background-color:#1f1f1f;}
.cF3{color:#297582;background-color:#1f1f1f;}
.cF4{color:#b34f4b;background-color:#1f1f1f;}
.cF5{color:#8a52c3;background-color:#1f1f1f;}
.cF6{color:#b7822f;background-color:#1f1f1f;}
.cF7{color:#444444;background-color:#1f1f1f;}
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
.cF9{color:#94bfde;background-color:#1f1f1f;}
.cFA{color:#a1ce97;background-color:#1f1f1f;}
.cFB{color:#6db4be;background-color:#1f1f1f;}
.cFC{color:#e88e88;background-color:#1f1f1f;}
.cFD{color:#ca94e8;background-color:#1f1f1f;}
.cFE{color:#d4b475;background-color:#1f1f1f;}
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF9>CDirEntry</span><span class=cF0> OSFilesMGFind(</span><span class=cF9>CDirEntry</span><span class=cF0> *needle_entry, </span><span class=cF9>CDirEntry</span><span class=cF0> *haystack_list)
<a name="l2"></a>{
<a name="l3"></a> </span><span class=cF1>while</span><span class=cF0> (haystack_list)
<a name="l4"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l5"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>needle_entry-&gt;name, haystack_list-&gt;name</span><span class=cF7>)</span><span class=cF0>)
<a name="l6"></a> </span><span class=cF1>return</span><span class=cF0> haystack_list;
<a name="l7"></a> haystack_list = haystack_list-&gt;next;
<a name="l8"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l9"></a>
<a name="l10"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l11"></a>}
<a name="l12"></a>
<a name="l13"></a></span><span class=cF1>U0</span><span class=cF0> OSFilesMergeInner(</span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde1, </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde2, </span><span class=cF9>I64</span><span class=cF0> *_fuf_flags, </span><span class=cF9>I64</span><span class=cF0> *_df_flags)
<a name="l14"></a>{
<a name="l15"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde;
<a name="l16"></a> </span><span class=cF1>U8</span><span class=cF0> *new;
<a name="l17"></a>
<a name="l18"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde1 &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>*_df_flags &amp; </span><span class=cF3>DF_ABORT_ALL_FILES</span><span class=cF7>)</span><span class=cF0>)
<a name="l19"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l20"></a> tmpde = OSFilesMGFind(tmpde1, tmpde2);
<a name="l21"></a> </span><span class=cF1>if</span><span class=cF0> (!tmpde)
<a name="l22"></a> {
<a name="l23"></a> </span><span class=cF6>&quot;$BROWN$Does Not Exist:%s$FG$\n&quot;</span><span class=cF0>, tmpde1-&gt;full_name;
<a name="l24"></a> new = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde1-&gt;full_name);
<a name="l25"></a> new[</span><span class=cFE>0</span><span class=cF0>] = tmpde2-&gt;full_name[</span><span class=cFE>0</span><span class=cF0>]; </span><span class=cF2>// shortcut to quickly get drive letter</span><span class=cF0>
<a name="l26"></a> </span><span class=cF5>Copy</span><span class=cF0>(tmpde1-&gt;full_name, new);
<a name="l27"></a> </span><span class=cF5>Free</span><span class=cF0>(new);
<a name="l28"></a> }
<a name="l29"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l30"></a> {
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde1-&gt;attr &amp; </span><span class=cF3>RS_ATTR_DIR</span><span class=cF0>)
<a name="l32"></a> OSFilesMergeInner(tmpde1-&gt;sub, tmpde-&gt;sub, _fuf_flags, _df_flags);
<a name="l33"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l34"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l35"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>AbsI64</span><span class=cF7>(</span><span class=cF0>tmpde1-&gt;datetime - tmpde-&gt;datetime</span><span class=cF7>)</span><span class=cF0> &gt; </span><span class=cF3>CDATE_FREQ</span><span class=cF0> * </span><span class=cFE>2</span><span class=cF0>) {</span><span class=cF2>//slop</span><span class=cF0>
<a name="l36"></a> </span><span class=cF6>&quot;\n$LTRED$%s$FG$\n&quot;</span><span class=cF0>, tmpde-&gt;full_name;
<a name="l37"></a> </span><span class=cF6>&quot;$LTGREEN$%s$FG$&quot;</span><span class=cF0>, tmpde1-&gt;full_name;
<a name="l38"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l39"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>_fuf_flags, </span><span class=cF3>FUf_DIFF</span><span class=cF7>)</span><span class=cF0>)
<a name="l40"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l41"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>FilesFindMatch</span><span class=cF7>(</span><span class=cF0>tmpde1-&gt;full_name, </span><span class=cF3>FILEMASK_TXT</span><span class=cF7>)</span><span class=cF0>)
<a name="l42"></a> </span><span class=cF5>Diff</span><span class=cF0>(tmpde-&gt;full_name, tmpde1-&gt;full_name, _df_flags);
<a name="l43"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l44"></a> }
<a name="l45"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l46"></a> }
<a name="l47"></a> tmpde1 = tmpde1-&gt;next;
<a name="l48"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l49"></a>}
<a name="l50"></a>
<a name="l51"></a></span><span class=cF1>U0</span><span class=cF0> OSFilesMerge(</span><span class=cF1>U8</span><span class=cF0> *dst_files_find_mask=</span><span class=cF6>&quot;/*&quot;</span><span class=cF0>, </span><span class=cF1>U8</span><span class=cF0> *src_files_find_mask=</span><span class=cF6>&quot;/*&quot;</span><span class=cF0>, </span><span class=cF1>U8</span><span class=cF0> *fu_flags=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l52"></a>{ </span><span class=cF2>// See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/Utils/Merge.CC.html#l45"><span class=cF4>Merge</span></a><span class=cF2>.</span><span class=cF0>
<a name="l53"></a> </span><span class=cF9>I64</span><span class=cF0> df_flags = </span><span class=cFE>0</span><span class=cF0>, fuf_flags = </span><span class=cFE>0</span><span class=cF0>;
<a name="l54"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde1 = </span><span class=cF3>NULL</span><span class=cF0>, *tmpde2 = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l55"></a>
<a name="l56"></a> </span><span class=cF5>FlagsScan</span><span class=cF0>(&amp;fuf_flags, </span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>&quot;ST_FILE_UTIL_FLAGS&quot;</span><span class=cF7>)</span><span class=cF0>, </span><span class=cF6>&quot;+r&quot;</span><span class=cF0>);
<a name="l57"></a> </span><span class=cF5>FlagsScan</span><span class=cF0>(&amp;fuf_flags, </span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>&quot;ST_FILE_UTIL_FLAGS&quot;</span><span class=cF7>)</span><span class=cF0>, fu_flags);
<a name="l58"></a> </span><span class=cF1>if</span><span class=cF0> (fuf_flags &amp; ~</span><span class=cF7>(</span><span class=cF3>FUG_FILES_FIND</span><span class=cF0> | </span><span class=cF3>FUF_DIFF</span><span class=cF7>)</span><span class=cF0>)
<a name="l59"></a> </span><span class=cF5>throw</span><span class=cF0>(</span><span class=cF6>'FUF'</span><span class=cF0>);
<a name="l60"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>&quot;This is based strictly on file dates.\n&quot;</span><span class=cF0>);
<a name="l61"></a> tmpde1 = </span><span class=cF5>FilesFind</span><span class=cF0>(src_files_find_mask, fuf_flags &amp; </span><span class=cF3>FUG_FILES_FIND</span><span class=cF0>);
<a name="l62"></a> tmpde2 = </span><span class=cF5>FilesFind</span><span class=cF0>(dst_files_find_mask, fuf_flags &amp; </span><span class=cF3>FUG_FILES_FIND</span><span class=cF0>);
<a name="l63"></a> fuf_flags &amp;= </span><span class=cF3>FUF_DIFF</span><span class=cF0>;
<a name="l64"></a> OSFilesMergeInner(tmpde1, tmpde2, &amp;fuf_flags, &amp;df_flags);
<a name="l65"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde1);
<a name="l66"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde2);
<a name="l67"></a>}
<a name="l68"></a>
<a name="l69"></a>
<a name="l70"></a></span><span class=cF1>U0</span><span class=cF0> OSMerge(</span><span class=cF1>U8</span><span class=cF0> dst_drv, </span><span class=cF1>U8</span><span class=cF0> src_drv=</span><span class=cF6>':'</span><span class=cF0>)
<a name="l71"></a>{
<a name="l72"></a> </span><span class=cF1>U8</span><span class=cF0> *dst = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;%C:/&quot;</span><span class=cF0>, dst_drv);
<a name="l73"></a> </span><span class=cF1>U8</span><span class=cF0> *src = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;%C:/&quot;</span><span class=cF0>, src_drv);
<a name="l74"></a>
<a name="l75"></a> </span><span class=cF5>CopyTree</span><span class=cF0>(src, </span><span class=cF6>&quot;B:/&quot;</span><span class=cF0>);
<a name="l76"></a> OSFilesMerge(</span><span class=cF6>&quot;B:/&quot;</span><span class=cF0>, dst, </span><span class=cF6>&quot;+d&quot;</span><span class=cF0>);
<a name="l77"></a> </span><span class=cF6>&quot;Format %C:/ ? &quot;</span><span class=cF0>, dst_drv;
<a name="l78"></a> </span><span class=cF5>Format</span><span class=cF0>(dst_drv);
<a name="l79"></a> </span><span class=cF5>CopyTree</span><span class=cF0>(</span><span class=cF6>&quot;B:/&quot;</span><span class=cF0>, dst);
<a name="l80"></a>}
<a name="l81"></a>
<a name="l82"></a></span><span class=cF1>U0</span><span class=cF0> OSUpgrade()
<a name="l83"></a>{
<a name="l84"></a> </span><span class=cF9>I64</span><span class=cF0> drv_let;
<a name="l85"></a> </span><span class=cF1>U8</span><span class=cF0> *st, *port_st;
<a name="l86"></a> </span><span class=cF9>I64</span><span class=cF0> res_num;
<a name="l87"></a> </span><span class=cF9>CTask</span><span class=cF0> *task;
<a name="l88"></a>
<a name="l89"></a> task = </span><span class=cF5>User</span><span class=cF0>;
<a name="l90"></a> </span><span class=cF5>TaskWait</span><span class=cF0>(task);
<a name="l91"></a> task-&gt;border_src = </span><span class=cF3>BDS_CONST</span><span class=cF0>;
<a name="l92"></a> task-&gt;border_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> &lt;&lt; </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF5>DriveTextAttrGet</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>) &amp; </span><span class=cFE>15</span><span class=cF0>;
<a name="l93"></a> task-&gt;text_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> &lt;&lt; </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF3>BLUE</span><span class=cF0>;
<a name="l94"></a> task-&gt;win_inhibit = </span><span class=cF3>WIG_TASK_DEFAULT</span><span class=cF0> - </span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0>;
<a name="l95"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_left, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_right, task);
<a name="l96"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_top, </span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_top + </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>, task);
<a name="l97"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_bottom + </span><span class=cFE>3</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom);
<a name="l98"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>);
<a name="l99"></a>
<a name="l100"></a> </span><span class=cF5>XTalk</span><span class=cF0>(task, </span><span class=cF6>&quot;Mount;\nC\n&quot;</span><span class=cF0>);
<a name="l101"></a>
<a name="l102"></a> </span><span class=cF6>&quot;\n\nSelect the port of the ATA drive with an existing installation.\n\n&quot;</span><span class=cF0>;
<a name="l103"></a>
<a name="l104"></a> </span><span class=cF6>&quot;Hard Drive Port: &quot;</span><span class=cF0>;
<a name="l105"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
<a name="l106"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l107"></a> port_st = </span><span class=cF5>StrGet</span><span class=cF0>;
<a name="l108"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cFE>0</span><span class=cF0> &lt;= </span><span class=cF5>Str2I64</span><span class=cF0>(port_st) &lt; </span><span class=cF3>AHCI_MAX_PORTS</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l109"></a> </span><span class=cF7>(</span><span class=cF0>(&amp;</span><span class=cFB>blkdev</span><span class=cF0>.ahci_hba-&gt;ports[</span><span class=cF5>Str2I64</span><span class=cF7>(</span><span class=cF0>port_st</span><span class=cF7>)</span><span class=cF0>])-&gt;signature == </span><span class=cF3>AHCI_PxSIG_ATA</span><span class=cF7>)</span><span class=cF0>)
<a name="l110"></a> {
<a name="l111"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l112"></a> }
<a name="l113"></a> </span><span class=cF5>Free</span><span class=cF0>(port_st);
<a name="l114"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l115"></a>
<a name="l116"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;%s\n\n&quot;</span><span class=cF0>, port_st);
<a name="l117"></a>
<a name="l118"></a> </span><span class=cF5>DriveRep</span><span class=cF0>;
<a name="l119"></a> </span><span class=cF1>do</span><span class=cF0>
<a name="l120"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l121"></a> st = </span><span class=cF5>StrGet</span><span class=cF0>(</span><span class=cF6>&quot;\nInstallation Partition Letter: &quot;</span><span class=cF0>);
<a name="l122"></a> </span><span class=cF1>if</span><span class=cF0> (*st)
<a name="l123"></a> drv_let = </span><span class=cF5>Letter2Letter</span><span class=cF0>(*st);
<a name="l124"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l125"></a> drv_let = </span><span class=cFE>0</span><span class=cF0>;
<a name="l126"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l127"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l128"></a> </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF6>'A'</span><span class=cF0> &lt;= drv_let &lt;= </span><span class=cF6>'Z'</span><span class=cF7>)</span><span class=cF0>);
<a name="l129"></a>
<a name="l130"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l131"></a>
<a name="l132"></a> </span><span class=cF5>PopUpOk</span><span class=cF0>(</span><span class=cF6>&quot;\n$LTRED$FILE1$FG$ is new changes.\n&quot;</span><span class=cF0>
<a name="l133"></a> </span><span class=cF6>&quot;$LTGREEN$FILE2$FG$ is from existing install.\n\n&quot;</span><span class=cF0>
<a name="l134"></a> </span><span class=cF6>&quot;You can hold $GREEN$SPACE$FG$ down to just merge everything.&quot;</span><span class=cF0>);
<a name="l135"></a> OSMerge(drv_let); </span><span class=cF2>// src_drv needed?</span><span class=cF0>
<a name="l136"></a>
<a name="l137"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;BootHDIns('%C');\n\nB\n0x20000\n%C\n%s\n\n&quot;</span><span class=cF0>, drv_let, drv_let, port_st);
<a name="l138"></a> </span><span class=cF5>VideoRep</span><span class=cF0>;
<a name="l139"></a> res_num = </span><span class=cF5>I64Get</span><span class=cF0>(</span><span class=cF6>&quot;Enter desired list num ($PURPLE$&lt;ENTER&gt;$FG$ for max res): &quot;</span><span class=cF0>,, </span><span class=cFE>1</span><span class=cF0>);
<a name="l140"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;%d\n\n\n&quot;</span><span class=cF0>, res_num); </span><span class=cF2>//skip through Disk Cache, Options</span><span class=cF0>
<a name="l141"></a>
<a name="l142"></a> </span><span class=cF6>&quot;$RED$Install Master Boot Loader?$FG$&quot;</span><span class=cF0>;
<a name="l143"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>YorN</span><span class=cF0>)
<a name="l144"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l145"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l146"></a> </span><span class=cF5>BootMHDIns</span><span class=cF0>(drv_let);
<a name="l147"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l148"></a>
<a name="l149"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_top, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom);
<a name="l150"></a> </span><span class=cF5>Kill</span><span class=cF0>(task);
<a name="l151"></a>}
<a name="l152"></a>
<a name="l153"></a></span><span class=cF1>U0</span><span class=cF0> InstallDrive(</span><span class=cF1>U8</span><span class=cF0> drv_let)
<a name="l154"></a>{
<a name="l155"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
<a name="l156"></a>
<a name="l157"></a> </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF5>DriveCheck</span><span class=cF7>(</span><span class=cFB>blkdev</span><span class=cF0>.let_to_drive[drv_let - </span><span class=cF6>'A'</span><span class=cF0>], </span><span class=cF3>FALSE</span><span class=cF7>)</span><span class=cF0>)
<a name="l158"></a> </span><span class=cF5>Sleep</span><span class=cF0>(</span><span class=cFE>1</span><span class=cF0>);
<a name="l159"></a> </span><span class=cF5>Sleep</span><span class=cF0>(</span><span class=cFE>1000</span><span class=cF0>);
<a name="l160"></a>
<a name="l161"></a> </span><span class=cF5>ExePrint</span><span class=cF0>(</span><span class=cF6>&quot;CopyTree(\&quot;::/\&quot;,\&quot;%C:/\&quot;);&quot;</span><span class=cF0>, drv_let);
<a name="l162"></a> </span><span class=cF5>ExePrint</span><span class=cF0>(</span><span class=cF6>&quot;DirMake(\&quot;%C:/Tmp\&quot;);&quot;</span><span class=cF0>, drv_let);
<a name="l163"></a> </span><span class=cF5>ExePrint</span><span class=cF0>(</span><span class=cF6>&quot;DirMake(\&quot;%C:/Tmp/ScreenShots\&quot;);&quot;</span><span class=cF0>, drv_let);
<a name="l164"></a> </span><span class=cF5>ExePrint</span><span class=cF0>(</span><span class=cF6>&quot;DirMake(\&quot;%C:/Home\&quot;);&quot;</span><span class=cF0>, drv_let);
<a name="l165"></a>
<a name="l166"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;%C:/Home/DoDistro.CC&quot;</span><span class=cF0>, drv_let);
<a name="l167"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>FileFind</span><span class=cF7>(</span><span class=cF0>st</span><span class=cF7>)</span><span class=cF0>)
<a name="l168"></a> </span><span class=cF5>Copy</span><span class=cF0>(</span><span class=cF6>&quot;::/Misc/DoDistro.CC&quot;</span><span class=cF0>, st);
<a name="l169"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l170"></a>
<a name="l171"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;%C:/Home/MakeHome.CC&quot;</span><span class=cF0>, drv_let);
<a name="l172"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>FileFind</span><span class=cF7>(</span><span class=cF0>st</span><span class=cF7>)</span><span class=cF0>)
<a name="l173"></a> </span><span class=cF5>Copy</span><span class=cF0>(</span><span class=cF6>&quot;::/MakeHome.CC&quot;</span><span class=cF0>, st);
<a name="l174"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l175"></a>}
<a name="l176"></a>
<a name="l177"></a></span><span class=cF1>Bool</span><span class=cF0> VMPartDisk(</span><span class=cF9>CTask</span><span class=cF0> *task, </span><span class=cF9>I64</span><span class=cF0> ata_port)
<a name="l178"></a>{
<a name="l179"></a> </span><span class=cF1>if</span><span class=cF0> (ata_port &gt; -</span><span class=cFE>1</span><span class=cF0>)
<a name="l180"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l181"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;DiskPart(,0.5,0.5);\nC\n%d\nY&quot;</span><span class=cF0>, ata_port); </span><span class=cF2>// DOUBLE CHECK INFILE</span><span class=cF0>
<a name="l182"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l183"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l184"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l185"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l186"></a>}
<a name="l187"></a>
<a name="l188"></a></span><span class=cF1>U0</span><span class=cF0> VMInstallDrive(</span><span class=cF9>CTask</span><span class=cF0> *task, </span><span class=cF1>U8</span><span class=cF0> drv_let, </span><span class=cF9>I64</span><span class=cF0> ata_port, </span><span class=cF9>I64</span><span class=cF0> atapi_port)
<a name="l189"></a>{</span><span class=cF2>// DOUBLE CHECK INFILE</span><span class=cF0>
<a name="l190"></a> InstallDrive(drv_let);
<a name="l191"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;BootHDIns('%C');\n\nB\n0x20000\n&quot;</span><span class=cF0>, drv_let);
<a name="l192"></a> </span><span class=cF1>if</span><span class=cF0> (ata_port &gt; -</span><span class=cFE>1</span><span class=cF0>)
<a name="l193"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;C\n%d\n&quot;</span><span class=cF0>, ata_port);
<a name="l194"></a> </span><span class=cF1>if</span><span class=cF0> (atapi_port &gt; -</span><span class=cFE>1</span><span class=cF0>)
<a name="l195"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;T%d\n&quot;</span><span class=cF0>, atapi_port);
<a name="l196"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;\n1024\n768\n\n\n&quot;</span><span class=cF0>); </span><span class=cF2>//Exit Drives, set Screen Resolution, skip Disk Cache and Options</span><span class=cF0>
<a name="l197"></a>}
<a name="l198"></a>
<a name="l199"></a></span><span class=cF1>U0</span><span class=cF0> VMInstallWiz()
<a name="l200"></a>{
<a name="l201"></a> </span><span class=cF9>CTask</span><span class=cF0> *task;
<a name="l202"></a> </span><span class=cF9>I64</span><span class=cF0> i, atapi_port = -</span><span class=cFE>1</span><span class=cF0>, ata_port = -</span><span class=cFE>1</span><span class=cF0>;
<a name="l203"></a> </span><span class=cF9>CAHCIPort</span><span class=cF0> *port;
<a name="l204"></a>
<a name="l205"></a> task = </span><span class=cF5>User</span><span class=cF0>;
<a name="l206"></a> </span><span class=cF5>TaskWait</span><span class=cF0>(task);
<a name="l207"></a> task-&gt;border_src = </span><span class=cF3>BDS_CONST</span><span class=cF0>;
<a name="l208"></a> task-&gt;border_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> &lt;&lt; </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF5>DriveTextAttrGet</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>) &amp; </span><span class=cFE>15</span><span class=cF0>;
<a name="l209"></a> task-&gt;text_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> &lt;&lt; </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF3>BLUE</span><span class=cF0>;
<a name="l210"></a> task-&gt;win_inhibit = </span><span class=cF3>WIG_TASK_DEFAULT</span><span class=cF0> - </span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0>;
<a name="l211"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_left, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_right, task);
<a name="l212"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_top, </span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_top + </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>, task);
<a name="l213"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_bottom + </span><span class=cFE>3</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom);
<a name="l214"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>);
<a name="l215"></a>
<a name="l216"></a>
<a name="l217"></a> </span><span class=cF2>////////////////////////////////////</span><span class=cF0>
<a name="l218"></a> </span><span class=cF5>SATARep</span><span class=cF0>;
<a name="l219"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cF3>AHCI_MAX_PORTS</span><span class=cF0>; i++)
<a name="l220"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l221"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>blkdev</span><span class=cF0>.ahci_hba-&gt;ports_implemented, i</span><span class=cF7>)</span><span class=cF0>)
<a name="l222"></a> {
<a name="l223"></a> port = &amp;</span><span class=cFB>blkdev</span><span class=cF0>.ahci_hba-&gt;ports[i];
<a name="l224"></a> </span><span class=cF1>if</span><span class=cF0> (port-&gt;signature == </span><span class=cF3>AHCI_PxSIG_ATA</span><span class=cF0>)
<a name="l225"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l226"></a> ata_port = i;
<a name="l227"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l228"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l229"></a> }
<a name="l230"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l231"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cF3>AHCI_MAX_PORTS</span><span class=cF0>; i++)
<a name="l232"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l233"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>blkdev</span><span class=cF0>.ahci_hba-&gt;ports_implemented, i</span><span class=cF7>)</span><span class=cF0>)
<a name="l234"></a> {
<a name="l235"></a> port = &amp;</span><span class=cFB>blkdev</span><span class=cF0>.ahci_hba-&gt;ports[i];
<a name="l236"></a> </span><span class=cF1>if</span><span class=cF0> (port-&gt;signature == </span><span class=cF3>AHCI_PxSIG_ATAPI</span><span class=cF0>)
<a name="l237"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l238"></a> atapi_port = i;
<a name="l239"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l240"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l241"></a> }
<a name="l242"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l243"></a>
<a name="l244"></a> </span><span class=cF1>if</span><span class=cF0> (VMPartDisk</span><span class=cF7>(</span><span class=cF0>task, ata_port</span><span class=cF7>)</span><span class=cF0>)
<a name="l245"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l246"></a> VMInstallDrive(task, </span><span class=cF6>'C'</span><span class=cF0>, ata_port, atapi_port);
<a name="l247"></a> VMInstallDrive(task, </span><span class=cF6>'D'</span><span class=cF0>, ata_port, atapi_port);
<a name="l248"></a> </span><span class=cF5>BootMHDIns</span><span class=cF0>(</span><span class=cF6>'C'</span><span class=cF0>);
<a name="l249"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l250"></a>
<a name="l251"></a> </span><span class=cF2>////////////////////////////////////</span><span class=cF0>
<a name="l252"></a>
<a name="l253"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_top, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom);
<a name="l254"></a> </span><span class=cF5>Kill</span><span class=cF0>(task);
<a name="l255"></a>}
<a name="l256"></a>
<a name="l257"></a></span><span class=cF1>U0</span><span class=cF0> RegularInstallWiz()
<a name="l258"></a>{
<a name="l259"></a> </span><span class=cF9>I64</span><span class=cF0> drv_let;
<a name="l260"></a> </span><span class=cF1>U8</span><span class=cF0> *st, *port_st;
<a name="l261"></a> </span><span class=cF9>I64</span><span class=cF0> ch, res_num;
<a name="l262"></a> </span><span class=cF9>CTask</span><span class=cF0> *task;
<a name="l263"></a>
<a name="l264"></a> task = </span><span class=cF5>User</span><span class=cF0>;
<a name="l265"></a> </span><span class=cF5>TaskWait</span><span class=cF0>(task);
<a name="l266"></a> task-&gt;border_src = </span><span class=cF3>BDS_CONST</span><span class=cF0>;
<a name="l267"></a> task-&gt;border_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> &lt;&lt; </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF5>DriveTextAttrGet</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>) &amp; </span><span class=cFE>15</span><span class=cF0>;
<a name="l268"></a> task-&gt;text_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> &lt;&lt; </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF3>BLUE</span><span class=cF0>;
<a name="l269"></a> task-&gt;win_inhibit = </span><span class=cF3>WIG_TASK_DEFAULT</span><span class=cF0> - </span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0>;
<a name="l270"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_left, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_right, task);
<a name="l271"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_top, </span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;win_top + </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>, task);
<a name="l272"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_bottom + </span><span class=cFE>3</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom);
<a name="l273"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>);
<a name="l274"></a>
<a name="l275"></a> </span><span class=cF5>XTalk</span><span class=cF0>(task, </span><span class=cF6>&quot;Mount;\nC\n&quot;</span><span class=cF0>);
<a name="l276"></a>
<a name="l277"></a> </span><span class=cF6>&quot;\nSelect the port of the ATA drive to install on.\n&quot;</span><span class=cF0>;
<a name="l278"></a>
<a name="l279"></a> </span><span class=cF6>&quot;Hard Drive Port: &quot;</span><span class=cF0>;
<a name="l280"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
<a name="l281"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l282"></a> port_st = </span><span class=cF5>StrGet</span><span class=cF0>;
<a name="l283"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cFE>0</span><span class=cF0> &lt;= </span><span class=cF5>Str2I64</span><span class=cF0>(port_st) &lt; </span><span class=cF3>AHCI_MAX_PORTS</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l284"></a> </span><span class=cF7>(</span><span class=cF0>(&amp;</span><span class=cFB>blkdev</span><span class=cF0>.ahci_hba-&gt;ports[</span><span class=cF5>Str2I64</span><span class=cF7>(</span><span class=cF0>port_st</span><span class=cF7>)</span><span class=cF0>])-&gt;signature == </span><span class=cF3>AHCI_PxSIG_ATA</span><span class=cF7>)</span><span class=cF0>)
<a name="l285"></a> {
<a name="l286"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l287"></a> }
<a name="l288"></a> </span><span class=cF5>Free</span><span class=cF0>(port_st);
<a name="l289"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l290"></a>
<a name="l291"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;%s\n\n&quot;</span><span class=cF0>, port_st);
<a name="l292"></a>
<a name="l293"></a> </span><span class=cF5>DriveRep</span><span class=cF0>;
<a name="l294"></a> </span><span class=cF1>do</span><span class=cF0>
<a name="l295"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l296"></a> st = </span><span class=cF5>StrGet</span><span class=cF0>(</span><span class=cF6>&quot;\nDestination Partition Letter: &quot;</span><span class=cF0>);
<a name="l297"></a> </span><span class=cF1>if</span><span class=cF0> (*st)
<a name="l298"></a> drv_let = </span><span class=cF5>Letter2Letter</span><span class=cF0>(*st);
<a name="l299"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l300"></a> drv_let = </span><span class=cFE>0</span><span class=cF0>;
<a name="l301"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l302"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l303"></a> </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF6>'A'</span><span class=cF0> &lt;= drv_let &lt;= </span><span class=cF6>'Z'</span><span class=cF7>)</span><span class=cF0>);
<a name="l304"></a>
<a name="l305"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l306"></a>
<a name="l307"></a> </span><span class=cF6>&quot;$RED$Format %C Partition?$FG$\n&quot;</span><span class=cF0>, drv_let;
<a name="l308"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>YorN</span><span class=cF0>)
<a name="l309"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l310"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l311"></a> </span><span class=cF1>do</span><span class=cF0>
<a name="l312"></a> {
<a name="l313"></a> </span><span class=cF6>&quot;$PURPLE$1$FG$) Use FAT32\n&quot;</span><span class=cF0>
<a name="l314"></a> </span><span class=cF6>&quot;$PURPLE$2$FG$) Use RedSea\n&quot;</span><span class=cF0>
<a name="l315"></a> </span><span class=cF6>&quot;\nFile System Type: &quot;</span><span class=cF0>;
<a name="l316"></a> ch = </span><span class=cF5>CharGet</span><span class=cF0>;
<a name="l317"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l318"></a> }
<a name="l319"></a> </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF6>'1'</span><span class=cF0> &lt;= ch &lt;= </span><span class=cF6>'2'</span><span class=cF7>)</span><span class=cF0>);
<a name="l320"></a>
<a name="l321"></a> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>'1'</span><span class=cF0>)
<a name="l322"></a> </span><span class=cF5>Format</span><span class=cF0>(drv_let,, </span><span class=cF3>FALSE</span><span class=cF0>, </span><span class=cF3>FSt_FAT32</span><span class=cF0>);
<a name="l323"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l324"></a> </span><span class=cF5>Format</span><span class=cF0>(drv_let,, </span><span class=cF3>FALSE</span><span class=cF0>, </span><span class=cF3>FSt_REDSEA</span><span class=cF0>);
<a name="l325"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l326"></a> InstallDrive(drv_let);
<a name="l327"></a>
<a name="l328"></a>
<a name="l329"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;BootHDIns('%C');\n\nB\n0x20000\nC\n%s\n\n&quot;</span><span class=cF0>, drv_let, port_st);
<a name="l330"></a> </span><span class=cF5>VideoRep</span><span class=cF0>;
<a name="l331"></a> res_num = </span><span class=cF5>I64Get</span><span class=cF0>(</span><span class=cF6>&quot;Enter desired list num ($PURPLE$&lt;ENTER&gt;$FG$ for max res): &quot;</span><span class=cF0>,, </span><span class=cFE>1</span><span class=cF0>);
<a name="l332"></a> </span><span class=cF5>XTalkWait</span><span class=cF0>(task, </span><span class=cF6>&quot;%d\n\n\n&quot;</span><span class=cF0>, res_num); </span><span class=cF2>//skip through Disk Cache, Options</span><span class=cF0>
<a name="l333"></a> </span><span class=cF6>&quot;$RED$Install Master Boot loader?$FG$&quot;</span><span class=cF0>;
<a name="l334"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>YorN</span><span class=cF0>)
<a name="l335"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l336"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l337"></a> </span><span class=cF5>BootMHDIns</span><span class=cF0>(drv_let);
<a name="l338"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l339"></a>
<a name="l340"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_top, </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom);
<a name="l341"></a> </span><span class=cF5>Kill</span><span class=cF0>(task);
<a name="l342"></a>}
<a name="l343"></a>
<a name="l344"></a></span><span class=cF1>U0</span><span class=cF0> DoInstructions()
<a name="l345"></a>{
<a name="l346"></a> </span><span class=cF9>CTask</span><span class=cF0> *task = </span><span class=cF5>User</span><span class=cF0>;
<a name="l347"></a>
<a name="l348"></a> </span><span class=cF5>AutoComplete</span><span class=cF0>;
<a name="l349"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>);
<a name="l350"></a> </span><span class=cF5>WinTileVert</span><span class=cF0>;
<a name="l351"></a> </span><span class=cF5>XTalk</span><span class=cF0>(task, </span><span class=cF6>&quot;Ed(\&quot;::/Doc/Install.DD\&quot;);\n&quot;</span><span class=cF0>);
<a name="l352"></a>}
<a name="l353"></a>
<a name="l354"></a></span><span class=cF1>Bool</span><span class=cF0> DoInstall(</span><span class=cF1>Bool</span><span class=cF0> prompt_reboot)
<a name="l355"></a>{
<a name="l356"></a> </span><span class=cF9>I64</span><span class=cF0> res = </span><span class=cF3>FALSE</span><span class=cF0>, vm_install = </span><span class=cF3>TRUE</span><span class=cF0>, ch;
<a name="l357"></a> </span><span class=cF9>CSMBIOSSystemInfo</span><span class=cF0> *sys_info = </span><span class=cF5>SMBIOSStructGet</span><span class=cF0>(</span><span class=cF3>SMBIOSt_SYSTEM</span><span class=cF0>);
<a name="l358"></a> </span><span class=cF1>U8</span><span class=cF0> *company = </span><span class=cF5>SMBIOSStr</span><span class=cF0>(sys_info, sys_info-&gt;manufacturer);
<a name="l359"></a>
<a name="l360"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>company, </span><span class=cF6>&quot;VMware, Inc.&quot;</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>company, </span><span class=cF6>&quot;innotek GmbH&quot;</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>company, </span><span class=cF6>&quot;QEMU&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l361"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l362"></a> </span><span class=cF6>&quot;\n\n\n\n\nAre you installing inside VMware, QEMU, VirtualBox or a similar virtual machine? &quot;</span><span class=cF0>;
<a name="l363"></a> vm_install = </span><span class=cF5>YorN</span><span class=cF0>;
<a name="l364"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l365"></a> </span><span class=cF5>DocBottom</span><span class=cF0>;
<a name="l366"></a> </span><span class=cF1>if</span><span class=cF0> (vm_install)
<a name="l367"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l368"></a> </span><span class=cF6>&quot;\n\nUpgrade an existing install,&quot;</span><span class=cF0>
<a name="l369"></a> </span><span class=cF6>&quot;\nor create new Installation? (U/I): &quot;</span><span class=cF0>;
<a name="l370"></a> </span><span class=cF1>do</span><span class=cF0>
<a name="l371"></a> ch = </span><span class=cF5>ToUpper</span><span class=cF0>(</span><span class=cF5>CharGet</span><span class=cF7>(</span><span class=cF0>, </span><span class=cF3>FALSE</span><span class=cF7>)</span><span class=cF0>);
<a name="l372"></a> </span><span class=cF1>while</span><span class=cF0> (ch != </span><span class=cF6>'U'</span><span class=cF0> &amp;&amp; ch != </span><span class=cF6>'I'</span><span class=cF0>);
<a name="l373"></a>
<a name="l374"></a> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>'U'</span><span class=cF0>)
<a name="l375"></a> {
<a name="l376"></a> OSUpgrade;
<a name="l377"></a> prompt_reboot = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l378"></a> }
<a name="l379"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l380"></a> VMInstallWiz();
<a name="l381"></a>
<a name="l382"></a> res = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l383"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l384"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l385"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l386"></a> </span><span class=cF6>&quot;\n\nThis wizard works if you have a partition ready. You can partition the drive or BootHDIns() &quot;</span><span class=cF0>
<a name="l387"></a> </span><span class=cF6>&quot;with more options if you do it by hand, not using this wizard.\n\n&quot;</span><span class=cF0>
<a name="l388"></a> </span><span class=cF6>&quot;Continue Install Wizard &quot;</span><span class=cF0>;
<a name="l389"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>YorN</span><span class=cF0>)
<a name="l390"></a> {
<a name="l391"></a> </span><span class=cF6>&quot;\n\nUpgrade an existing install,&quot;</span><span class=cF0>
<a name="l392"></a> </span><span class=cF6>&quot;\nor create new Installation? (U/I): &quot;</span><span class=cF0>;
<a name="l393"></a> </span><span class=cF1>do</span><span class=cF0>
<a name="l394"></a> ch = </span><span class=cF5>ToUpper</span><span class=cF0>(</span><span class=cF5>CharGet</span><span class=cF7>(</span><span class=cF0>, </span><span class=cF3>FALSE</span><span class=cF7>)</span><span class=cF0>);
<a name="l395"></a> </span><span class=cF1>while</span><span class=cF0> (ch != </span><span class=cF6>'U'</span><span class=cF0> &amp;&amp; ch != </span><span class=cF6>'I'</span><span class=cF0>);
<a name="l396"></a>
<a name="l397"></a> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>'I'</span><span class=cF0>)
<a name="l398"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l399"></a> RegularInstallWiz();
<a name="l400"></a> res = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l401"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l402"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l403"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l404"></a> OSUpgrade;
<a name="l405"></a> prompt_reboot = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l406"></a> res = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l407"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l408"></a> }
<a name="l409"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l410"></a> prompt_reboot = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l411"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l412"></a> </span><span class=cF1>if</span><span class=cF0> (prompt_reboot)
<a name="l413"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l414"></a> </span><span class=cF6>&quot;Reboot Now &quot;</span><span class=cF0>;
<a name="l415"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>YorN</span><span class=cF0>)
<a name="l416"></a> {
<a name="l417"></a> </span><span class=cF5>DiscEject</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>);
<a name="l418"></a> </span><span class=cF5>Reboot</span><span class=cF0>;
<a name="l419"></a> };
<a name="l420"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l421"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l422"></a>}
<a name="l423"></a>
<a name="l424"></a></span><span class=cF1>Bool</span><span class=cF0> OSInstall(</span><span class=cF1>Bool</span><span class=cF0> prompt_reboot=</span><span class=cF3>TRUE</span><span class=cF0>)
<a name="l425"></a>{
<a name="l426"></a> DoInstructions;
<a name="l427"></a>
<a name="l428"></a> </span><span class=cF1>return</span><span class=cF0> DoInstall(prompt_reboot);
<a name="l429"></a>}
<a name="l430"></a>
<a name="l431"></a>#</span><span class=cF1>if</span><span class=cF0> </span><span class=cF3>__CMD_LINE__</span><span class=cF0>
<a name="l432"></a>OSInstall(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l433"></a>#</span><span class=cF1>endif</span><span class=cF0>
</span></pre></body>
</html>