Initialize .windows-serial when creating wineprefix (eterbug #6942).
authorAlexander Morozov <amorozov@etersoft.ru>
Tue, 15 Mar 2011 14:21:04 +0000 (17:21 +0300)
committerTest Robot <wine-patches-test@office.etersoft.ru>
Tue, 15 Mar 2011 16:17:46 +0000 (19:17 +0300)
etersoft/scripts/wine.in

index a716a50c35f5eea1017618c9ecc784fa88405e50..3637869eb2938e9b6d48707cbfae9eda9eb762ca 100644 (file)
@@ -328,6 +328,12 @@ find_type()
                cd - >/dev/null
        fi
 
+       if [ ! "$WINEMODE" = "--attach" ] && [ ! -e $CROOT/.windows-serial ] ; then
+               # $RANDOM does not work in dash (Ubuntu default shell) so /dev/urandom is used
+               # echo is used to remove space at the beginning of od output
+               echo $(od -t x4 -A n -N 4 /dev/urandom) > $CROOT/.windows-serial
+       fi
+
        # jump to C: before run internal wine programs
        cd "$CROOT/$WINTEMP"
        step_progress