summaryrefslogtreecommitdiff
path: root/data/install-scripts/windows-cmd.xml
blob: b3121dcaa19d097f7c35e9b923b857bda9e68967 (plain)
1
2
3
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<libosinfo version="0.0.1">
  <!-- DESKTOP PROFILE -->
  <install-script id='http://microsoft.com/windows/cmd/desktop'>
    <profile>desktop</profile>
    <path-format>dos</path-format>
    <expected-filename>windows.cmd</expected-filename>
    <can-post-install-drivers>true</can-post-install-drivers>
    <config>
      <param name="admin-password" policy="optional"/>
      <param name="user-realname" policy="required"/>
      <param name="avatar-location" policy="optional"/>
      <param name="avatar-disk" policy="optional"/>
      <param name="target-disk" policy="optional"/>
      <param name="script-disk" policy="optional"/>
      <param name="post-install-drivers-disk" policy="optional"/>
      <param name="post-install-drivers-location" policy="optional"/>
    </config>
    <avatar-format>
      <mime-type>image/bmp</mime-type>
      <width>48</width>
      <height>48</height>
      <alpha>false</alpha>
    </avatar-format>
    <template>
      <xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        version="1.0">
        <xsl:output method="text"/>

        <xsl:template name="target-disk">
          <xsl:choose>
            <xsl:when test="config/target-disk != ''">
              <xsl:value-of select="config/target-disk"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:text>C</xsl:text>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:template>

        <xsl:template name="script-disk">
          <xsl:choose>
            <xsl:when test="config/script-disk != ''">
              <xsl:value-of select="config/script-disk"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:text>A</xsl:text>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:template>

        <xsl:template name="post-install-drivers-disk">
          <xsl:choose>
            <xsl:when test="config/post-install-drivers-disk != ''">
              <xsl:value-of select="config/post-install-drivers-disk"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:text>A</xsl:text>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:template>

	<xsl:template match="/install-script-config">
sc config TlntSvr start= auto
net user <xsl:value-of select="config/user-realname"/> <xsl:text> </xsl:text> <xsl:value-of select="config/admin-password"/> /add /passwordreq:no
net localgroup administrators <xsl:value-of select="config/user-realname"/> /add
net accounts /maxpwage:unlimited
if not "<xsl:value-of select="config/avatar-location"/>"=="" copy "<xsl:value-of select="config/avatar-disk"/>:<xsl:value-of select="config/avatar-location"/>" "<xsl:call-template name="target-disk"/>:\Documents and Settings\All Users\Application Data\Microsoft\User Account Pictures\<xsl:value-of select="config/user-realname"/>.bmp"
REGEDIT /S <xsl:call-template name="script-disk"/>:\windows.reg
<xsl:call-template name="post-install-drivers-disk"/>:
reg add "HKCU\Software\Policies\Microsoft\Windows NT\Driver Signing" /v BehaviorOnFailedVerify /t reg_dword /d 00000000 /f
for %%i in ("<xsl:call-template name="post-install-drivers-disk"/>:<xsl:value-of select="config/post-install-drivers-location"/>\*.cmd") do cmd /k %%i
reg add "HKCU\Software\Policies\Microsoft\Windows NT\Driver Signing" /v BehaviorOnFailedVerify /t reg_dword /d 00000001 /f
EXIT
	</xsl:template>
      </xsl:stylesheet>
    </template>
  </install-script>
</libosinfo>