vs2010/CLIENT_DATA/vs2010.ins
author Rail Aliev <rail@mozilla.com>
Fri, 09 Sep 2011 19:22:29 +0300
changeset 104 816402adc761
permissions -rw-r--r--
Bug 563317 - Install Visual C++ 2010 on build slaves. r=catlee

[Initial]
Message=Installing Microsoft Visual Studio 2010...
StayOnTop=false

[Aktionen]

DefVar $DIST_DIR$
DefVar $WinstRegKey$
DefVar $RebootVar$
DefVar $RebootFlag$


Set $DIST_DIR$ = "c:\opsi_vs2010_install"
Set $WinstRegKey$ = "HKLM\SOFTWARE\opsi.org\winst"
Set $RebootVar$ = "VS2010_RebootFlag"
Set $RebootFlag$ = GetRegistryStringValue("["+$WinstRegKey$+"] "+$RebootVar$)

if not (($RebootFlag$ = "1") or ($RebootFlag$ = "2") or ($RebootFlag$ = "3"))
    ; Step 1: Copy files, run setup, reboot
    Files_copy_dist
    Winbatch_install_vs2010
    Set $RebootFlag$ = "1"
    Registry_SaveRebootFlag
    ExitWindows /ImmediateReboot
else
    if ($RebootFlag$ = "1")
        ; Step 2: run setup, reboot
        Winbatch_install_vs2010
        Set $RebootFlag$ = "2"
        Registry_SaveRebootFlag
        ExitWindows /ImmediateReboot
    endif
    if ($RebootFlag$ = "2")
        ; Step 3: run setup, reboot
        ; Need to reboot here to allow windows to unblock setup files and
        ; cleanup properly
        Winbatch_install_vs2010
        Set $RebootFlag$ = "3"
        Registry_SaveRebootFlag
        ExitWindows /ImmediateReboot
    endif
    if ($RebootFlag$ = "3")
        ; Step 4: Cleanup
        Registry_DeleteRebootFlag
        Files_delete_dist
    endif
endif

[Winbatch_install_vs2010]
$DIST_DIR$\setup\setup.exe /unattendfile $DIST_DIR$\vs2010.ini /norestart

[Files_copy_dist]
copy -us %SCRIPTPATH%\vs2010_iso\*.* $DIST_DIR$
copy -us %SCRIPTPATH%\vs2010.ini $DIST_DIR$

[Files_delete_dist]
delete -sf $DIST_DIR$

[Registry_SaveRebootFlag]
openKey [$WinstRegKey$]
set "$RebootVar$" = "$RebootFlag$"

[Registry_DeleteRebootFlag]
openKey [$WinstRegKey$]
DeleteVar "$RebootVar$"