IORRT - The Official Office 2010 VL Rearm Solution

Discussion in 'MDL Projects and Applications' started by timesurfer, Dec 1, 2010.

Thread Status:
Not open for further replies.
  1. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Thank you all for testing and sharing your knowledge and scripting skills. I really appreciate it ;)
     
  2. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #142 timesurfer, Dec 5, 2010
    Last edited: Dec 5, 2010
    (OP)
    For me upon install it says the .hiv file is already installed do I wish to overwrite Yes or No?

    So guessing the .hiv file need to get deleted at uninstall?

    This happens even upon C option after install
     
  3. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
  4. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #144 timesurfer, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
  5. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    #145 tomah, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    That would depend on if the "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" directory should contain the other files or not. If not, we can remove the line. If they should be there (unfortunately I didn't check prior to installing IORRT the first time so I'm not sure), we can just do something like: DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"\backup.hiv after the XCOPY is done OR rearrange the order of the lines to delete it before the XCOPY but after the REG RESTORE.
     
  6. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #146 timesurfer, Dec 5, 2010
    Last edited: Dec 5, 2010
    (OP)
    How bout:

    DEL %SystemDrive%\IORRT\Backup.hiv

    lol...I can't figure it out :eek:
     
  7. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    #147 tomah, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    That would work if we didn't need it for the REG RESTORE. One way around it would be to move the REG RESTORE line above the XCOPY line and then after the RESTORE (but before the XCOPY) do your DEL above.

    I believe this should work:

    Code:
    NET STOP OSPPSVC
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG RESTORE "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    DEL %SystemDrive%\IORRT\Backup.hiv
    DEL %SystemDrive%\IORRT\IORRT.BAT
    xcopy /cheriky "%SystemDrive%\IORRT" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    NET START OSPPSVC
    
    The lines marked in red have a re-arranged order. The above will actually cause less files to be copied over and my be a little more efficient.
     
  8. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    post your IORRT.bat and I'll try to brick my office :eek:
     
  9. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    #149 tomah, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    Try this (in a VM of course;)):

    Code:
    @echo off
    @color 0C
    title IORRT
    
    REM Variables
    set InstallRoot=
    set OfficeArchType=
    
    REM Check Office Architecture Type
    if '%processor_architecture%'=='x86' Set OfficeArchType=32 && Goto:EndArchCheck
    goto:WOWCheck
    
    :WOWCheck
    2>nul REG QUERY HKLM\SOFTWARE\Microsoft\Office\14.0\Common | find /i "InstallRoot" 1>nul
    IF ERRORLEVEL 1 Set OfficeArchType=WOW && Goto:EndArchCheck
    Set OfficeArchType=64
    
    :EndArchCheck
    
    REM Get Office Installed Path
    if %OfficeArchType%==WOW (
    FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot" /v Path') DO SET InstallRoot=%%B 
    Goto:FoundPath
    )
    FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot" /v Path') DO SET InstallRoot=%%B
    
    :FoundPath
    
    REM Start OSPPSVC (To make sure it is started to prevent strange cases where it doesn't start automatically from failing (XP))
    1>nul 2>nul net start osppsvc
    
    :MAINMENU
    mode con: cols=45 lines=10
    CLS
    echo.
    echo.
    echo.  
    echo.    InfiniteOfficeRestoreRearmTask (IORRT) 
    echo.    
    echo.               A. Install
    echo.               B. Uninstall
    echo.               C. Restore/Rearm
    echo.               D. Status
    echo.               E. Exit
    echo.
      
    :CHOOSEACTION
    set /p userinp=    ^   Make your selection: 
    set userinp=%userinp:~0,1%
    if /i "%userinp%"=="A" goto Install
    if /i "%userinp%"=="B" goto Uninstall
    if /i "%userinp%"=="C" goto Restore/Rearm
    if /i "%userinp%"=="D" goto Status
    if /i "%userinp%"=="E" goto Exit
    echo.Try Again...
    GOTO CHOOSEACTION
    
    :Install
    CLS
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF ERRORLEVEL 1 (
    echo Installing IORRT
    ) ELSE (
    echo IORRT has already been installed!
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    mkdir "%SystemDrive%\IORRT"
    net stop osppsvc
    xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\IORRT"
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    net start osppsvc
    SET file=%SystemDrive%\IORRT\IORRT.bat
    IF EXIST %file% attrib -h %file% 
    echo @echo off >%file%
    echo net stop osppsvc >>%file%
    echo xcopy /cheriky "%SystemDrive%\IORRT" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" >>%file%
    echo REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file%
    echo REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file%
    echo reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv >>%file%
    echo net start osppsvc >>%file%
    echo IF Exist "%COMMONPROGRAMFILES%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( >>%file%
    echo "%COMMONPROGRAMFILES%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" >>%file%
    echo ) ELSE ( "%COMMONPROGRAMFILES(X86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" >>%file%
    echo ) >>%file%
    echo schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru "" >>%file%
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru ""
    echo.
    
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Uninstall
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF '%ERRORLEVEL%' EQU '0' (
    echo Uninstalling IORRT
    ) ELSE (
    echo IORRT is already uninstalled
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    net stop osppsvc
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG RESTORE "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    DEL %SystemDrive%\IORRT\Backup.hiv
    DEL %SystemDrive%\IORRT\IORRT.BAT
    xcopy /cheriky "%SystemDrive%\IORRT" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    net start osppsvc
    SET file=%SystemDrive%\IORRT
    IF EXIST %file% attrib -h %file%
    RD /S /Q  %file%
    schtasks /delete /tn "IORRT" /f
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Restore/Rearm
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF '%ERRORLEVEL%' EQU '0' (
    echo Restoring/Rearming IORRT
    ) ELSE (
    echo Install IORRT before you restore/rearm
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    net stop osppsvc
    xcopy /cheriky "%SystemDrive%\IORRT" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    net start osppsvc
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    schtasks /create /tn "IORRT" /tr '"%SystemDrive%\IORRT\IORRT.bat"' /sc daily /mo 1 /ru ""
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Status
    mode con: cols=64 lines=21
    title IORRT
    cd /D "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    IF ERRORLEVEL 1 echo IORRT is not yet Installed
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Exit
    
     
  10. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #150 timesurfer, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I still get confirmation...lol
     
  11. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    #151 tomah, Dec 5, 2010
    Last edited: Dec 5, 2010
    I think I might know what the problem is. Because you already have the "backup.hiv" there from a previous (beta, if you will) install, it is still there causing you some issues. Try this:

    1. Uninstall IORRT
    2. Manually delete the backup.hiv file (using Explorer or whatever) from "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform".
    3. Try installing, uninstalling, IORRT again.

    Of course, you should be trying the modified code from the previous post.
     
  12. woebetide

    woebetide MDL Member

    May 28, 2007
    240
    78
    10
    #152 woebetide, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
  13. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    #153 CODYQX4, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
  14. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #154 timesurfer, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
  15. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    #155 tomah, Dec 5, 2010
    Last edited: Dec 5, 2010
    Don't mean to beat this to death, but would you be able to clarify what check CODYQX4 put in, that caused the yes/no to come up? I don't seem to see it.
     
  16. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    The things before the MAINMENU. It checks office install path so you can cd to it and call ospp.vbs.

    I did not do anything with the backup.hiv. I see mine is still there in the folder and that appears to be the only issue.

    its in "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform".

    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" works perfectly fine, so just run that command when uninstalling or anywhere else you need it.
     
  17. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    I know you put in the Architecture and InstallPath checks. I just don't see how the backup.hiv yes/no question came from it. Anyways, as long as it works I guess.
     
  18. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #158 timesurfer, Dec 5, 2010
    Last edited: Dec 5, 2010
    (OP)
    Edit: Never mind...lol I get it now...lol
     
  19. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #159 timesurfer, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I removed this from the install function

    Code:
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    Here was how it was before

    Code:
    mkdir "%SystemDrive%\IORRT"
    net stop osppsvc
    xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\IORRT"
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    net start osppsvc
    Ya see I think it was over kill on the backups since the xcopy does it all ;)

    We just need an XP test now everyone...lol
     
  20. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    #160 tomah, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017