[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] [PATCH 10/10] Add desktop profile for Windows



On Wed, Jun 13, 2012 at 7:25 AM, Daniel P. Berrange <berrange redhat com> wrote:
> On Mon, Jun 11, 2012 at 11:23:11PM -0300, Fabiano Fidêncio wrote:
>> +     <xsl:template match="/install-script-config">
>> +sc config TlntSvr start= auto
>> +net user <xsl:value-of select="config/user-realname"/> <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
>> +copy a:\<xsl:value-of select="config/user-realname"/>.bmp "c:\Documents and Settings\All Users\Application Data\Microsoft\User Account Pictures"
>> +REGEDIT /S a:\windows.reg
>> +EXIT
>
>
> ...<continued my reply from the fedora patch>
>
> where as to use the Windows desktop profile, an application needs to know
> that they must provide a floppy disk containing an icon file in the BMP
> format.
>
> I'm wondering how we can avoid the need for applications to know about
> these OS specific requirements.
>
>
>
>> diff --git a/data/oses/windows.xml b/data/oses/windows.xml
>> index 8769511..2fb18be 100644
>> --- a/data/oses/windows.xml
>> +++ b/data/oses/windows.xml
>> @@ -308,7 +308,10 @@
>>      </resources>
>>
>>      <installer>
>> -      <script id='http://microsoft.com/windows/sif'/>
>> +      <script id='http://microsoft.com/windows/sif/jeos'/>
>> +      <script id='http://microsoft.com/windows/sif/desktop'/>
>> +      <script id='http://microsoft.com/windows/reg/desktop'/>
>> +      <script id='http://microsoft.com/windows/cmd/desktop'/>
>>      </installer>
>>    </os>
>
> I'm wondering if we should have one <install-script> that contains
> data for all 3 files, instead of one <install-script> per file.

Agree!

>
>
>> @@ -103,15 +103,18 @@ static void script_file_name_get(char *distro)
>>  {
>>      if (!(strcmp(distro, "win2k")) || !(strcmp(distro, "winxp")) ||
>>          !(strcmp(distro, "win2k3")) || !(strcmp(distro, "win2k3r3"))) {
>> -        output = g_strdup("windows.sif");
>> +        outputScripts = g_slist_append(outputScripts, g_strdup("windows.sif"));
>> +        outputScripts = g_slist_append(outputScripts, g_strdup("windows.reg"));
>> +        outputScripts = g_slist_append(outputScripts, g_strdup("windows.cmd"));
>
>
> I'm also wondering if we can change the XML database, such that we don't
> need to hardcode these filenames.

The same that I asked in another mail.
How could we set/get it from the XML?

>
>>      } else if (!(strcmp(distro, "win2k8")) || !(strcmp(distro, "win2k8r2")) ||
>>                 !(strcmp(distro, "vista")) || !(strcmp(distro, "win7")) ||
>>                 !(strcmp(distro, "win8"))) {
>> -        output = g_strdup("windows.xml");
>> +        outputScripts = g_slist_append(outputScripts, g_strdup("windows.xml"));
>>      } else {
>>          gsize len = sizeof(distro) + sizeof(".ks");
>> -        output = g_malloc(len);
>> +        gchar *output = g_malloc(len);
>>          g_snprintf(output, len, "%s.ks", distro);
>> +        outputScripts = g_slist_append(outputScripts, output);
>
> Can be better written as:
>
>     gchar *output = g_strdup_printf("%s.ks", distro)
>
>
>
> Considering all of this data, what if we were to change the <install-script>
> XML syntax to allow multiple output files, and also provide metadata about
> the external disk that needs to be provided, and the images (or other files)
> within it.
>
> eg something like:
>
>   <install-script id='http://microsoft.com/windows/sif'>
>     <profile>desktop</profile>
>
>     <assets>
>        <disk media='floppy'/>
>
>        <resource type='image'/>
>           <path>/user.bmp</path>
>           <mime-type>image/bmp</mime-type>
>           <width>64</width>
>           <height>64</height>
>        </image>
>     </assets>
>
>     <template filename='windows.sif'>
>       <xsl:stylesheet>
>         ....
>       </xsl:stylesheet>
>     </template>
>
>     <template filename='windows.cmd'>
>       <xsl:stylesheet>
>         ....
>       </xsl:stylesheet>
>     </template>
>
>     <template filename='windows.reg'>
>       <xsl:stylesheet>
>         ....
>       </xsl:stylesheet>
>     </template>
>   </install-script>
>
>
>
>
>   <install-script id='http://fedoraproject.org/kickstart'>
>     <profile>desktop</profile>
>
>     <assets>
>        <disk media='harddisk'/>
>
>        <resource type='image'/>
>           <path>/user.png</path>
>           <mime-type>image/png</mime-type>
>           <width>128</width>
>           <height>128</height>
>        </image>
>     </assets>
>
>     <template filename='fedora.ks'>
>       <xsl:stylesheet>
>         ....
>       </xsl:stylesheet>
>     </template>
>   </install-script>
>
>
>
> Daniel
> --
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



-- 
Fabiano Fidêncio


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]