none
Software installation startup-script via GPO RRS feed

  • Question

  • We would like to deploy a few applications to clients via GPO. The install packages are .exe and not .msi, hence we are not able to distribute via the normal "Computer Configuration\Policies\Software Settings\Software Installation" policy.

    Hence, we thought about using a startup script under "Computer Configuration\Policies\Windows Settings\Scripts\Startup". However, the software should only install once and not each startup. Hence, we thought that the results should be recorded in a text file, which is then read on startup and if the file exists, then don't install. At the moment our very basic script looks line this:

    IF EXIST "c:\vcredist_2010_x86.txt" GOTO END
    IF EXIST "c:\vcredist_2010_x64.txt" GOTO END
    
    :32-bit
    if exist %SystemRoot%\SysWOW64 goto 64-bit
    \\servername\sharename\C++Redist\2010\vcredist_2010_x86.exe /passive /norestart
    echo "Installed Microsoft Visual C++ 2010 Redistributable - x86" > "c:\vcredist_2010_x86.txt"
    goto END
    
    :64-bit
    \\servername\sharename\C++Redist\2010\vcredist_2010_x64.exe /passive /norestart
    echo "Installed Microsoft Visual C++ 2010 Redistributable - x64" > "c:\vcredist_2010_x64.txt"
    
    :END

    Works just fine, but we would like to refine it a little. Would be nice to have just 1 text file which is written to (i.e. c:\software-dist.txt) and per installation the relevant line (Software Name) be added to this file. On startup, the script should check to see if the line exists, if yes then don't install, if no then install the software.

    Any tips would be really appreciated. Thanks.


    Friday, October 26, 2012 9:55 AM

Answers

  • Thanks Stefan for your nice idea. Something like this:

    :32-bit
    if exist %SystemRoot%\SysWOW64 goto 64-bit
    find | reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86"
    If not ERRORLEVEL 1 \\servername\sharename\C++Redist\2010\vcredist_2010_x86.exe /passive /norestart
    goto END
    
    :64-bit
    find | reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64"
    If not ERRORLEVEL 1 \\servername\sharename\C++Redist\2010\vcredist_2010_x64.exe /passive /norestart
    
    :END
    Is there a 'nicer' way of how to check the OS (32 / 64-bit)? I also need to test for Microsoft Visual C++ 2005 & 2008 Redistributable, along with .Net Framework 4. I haven't been able to find any registry keys for these - any tips? Thanks again.
    Friday, October 26, 2012 12:14 PM

All replies