Rearm Wizard - The Premier Rearm Solution for Windows 7 and Office 2013

Discussion in 'MDL Projects and Applications' started by timesurfer, Mar 27, 2013.

  1. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
  2. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    #223 s1ave77, Apr 21, 2013
    Last edited by a moderator: Apr 20, 2017
    Tried different switches for no avail.

    It´s this part:
    Code:
    xcopy "%themefile%" /s /q "%vstore%\IR6Bkup.theme" /Y
    My test example for Check.bat:
    Code:
    @echo off
    setlocal ENABLEEXTENSIONS >nul
    
    ::define variables for check.bat
    set wppath=%appdata%\Microsoft\Windows\Themes >nul
    setx vstore "%appdata%\..\Local\VirtualStore\IR6" >nul
    set KEY_NAME=HKCU\Software\Microsoft\Windows\CurrentVersion\Themes
    set VALUE_NAME=CurrentTheme
    set spp=SoftwareLicensingProduct
    for /F "usebackq tokens=3" %%A IN (`reg query "%KEY_NAME%" /v "%VALUE_NAME%" 2^>nul ^| find "%VALUE_NAME%"`) do SET themefile=%%A
    mkdir %vstore% >nul
    echo. >>%vstore%\IR6Bkup.theme >nul
    echo. >>%vstore%\TranscodedWallpaper.jpg >nul
    
    ::determine whether license status is notification
    wmic path %spp% get LicenseStatus /format:list 2>nul | findstr /i 5 >nul 2>&1
    if %errorlevel%==0 goto :Rearm
    if %errorlevel%==1 goto :Backup
    
    ::theme settings backup
    :Backup
    xcopy "%wppath%\TranscodedWallpaper.jpg" /s /q "%vstore%" /Y
    xcopy "%themefile%" /s /q "%vstore%\IR6Bkup.theme" /Y
    pause
    goto :Exit
    
    ::rearm task
    :Rearm
    echo:
    for /f "usebackq tokens=2 delims==" %%n in (`"%SystemRoot%\System32\wbem\WMIC.exe" /namespace:\\root\cimv2 path SoftwareLicensingService get RemainingWindowsReArmCount /format:list`) do set r=%%n
    if %r% == 0 goto :Reinstall
    cscript.exe /b %windir%\system32\slmgr.vbs /rearm
    net stop sppsvc >NUL
    net start sppsvc >NUL
    schtasks /query | FINDSTR /i "IR6" >nul
    if %errorlevel%==0 (
    schtasks  /create /tn "IR6" /tr  "'%SystemDrive%\Windows\system32\cmd.exe' /c  cscript.exe /b  %SystemDrive%\Windows\System32\slmgr.vbs /rearm  && net stop  sppsvc && net start sppsvc" /sc daily /mo 30  /ru "" /f >NUL
    )
    xcopy "%vstore%\TranscodedWallpaper.jpg" /s /q "%wppath%\TranscodedWallpaper.jpg" /Y
    xcopy "%vstore%\IR6Bkup.theme" /s /q "C:\Windows\resources\Themes\IR6Bkup.theme" /Y
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes"  /t  REG_SZ /v CurrentTheme /d "C:\Windows\resources\Themes\IR6Bkup.theme" /f >NUL
    %vstore%\IR6Bkup.theme
    goto :Exit
    
    ::reinstall IR6
    :Reinstall
    ::Insert IR6 Reinstall message here
    
    :Exit
    exit
    Spared the Reinstall part so far. It extends the script significantly :D.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #224 timesurfer, Apr 21, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  5. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    I like comments, Ive never used them before this project but I see how handy they are now. Will it skip over the :: or should it be REM?

    @ timesurfer - okay. I only do what you see there cause its MUCH easier to test just that and then put it into what its going in once all is functioning.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    REM/:: is fine although I prefer REM

    I think you just have to not @echo off and Exit stuff

    Thank you guys

    :shisha:
     
  7. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340

    Simply insert InstallIR6 part from duality script after ":Reinstall" :D.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #230 timesurfer, Apr 21, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  11. qewlpal

    qewlpal MDL Addicted

    Jun 25, 2010
    575
    2,014
    30
    #231 qewlpal, Apr 21, 2013
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #233 timesurfer, Apr 21, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  14. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. qewlpal

    qewlpal MDL Addicted

    Jun 25, 2010
    575
    2,014
    30
    Dude that is not correct, this is


    IF %ERRORLEVEL% EQU 6 (call :ReinstallIR6) ELSE (IF %ERRORLEVEL% EQU 7 (call :UninstallIR6))
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Everything in hidden Rearm folder (Way to creat hidden folder is in IORRT part) but the tricky part is to get both IORRT and IR6 to detect if Rearm folder is there and act accordigly and leave folder if IR6 or IORRT is installed

    We are only working Check.bat having message at end of 180 day trial
    Yes IR6 install in both IR6 and Check.bat will need Rearm folder checks/deletes/etc...

    As will IORRT install/uninstall will need to checks/deletes/etc...

    In order to not uninstall what is still being used :poop:

    Original idea :worthy: spirit animal

    Is the msg part in right place for Check.bat?

    Thanks Dude :hug2:
     
  17. qewlpal

    qewlpal MDL Addicted

    Jun 25, 2010
    575
    2,014
    30
    I am with Humphrey here, as i too am quite confused and lost with the flow..o_O
    If some one can bullet point the flow/order it will be great..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #238 Humphrey, Apr 21, 2013
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Ok here is goes slow cause as much as I'm great with troubleshooting, original ideas, development and design it takes me a little longer than you guys to understand code. I lost about 5 years off my life designing and testing IORRT even when many said it was impossible :eek:

    We're working with two programs:

    IR6
    IORRT

    Both will use Rearm folder to put all their folders/files in?

    So we need to coordinate that if IR6 or IORRT is installed/uninstalled the Rearm folder stays for either programs use and if only one program is left and uninstalls then Rearm folder is deleted

    So we need to check for opposite files when deleting an program so that Rearm is left to contain opposite program folders/files

    Is that ok :shisha:
     
  20. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #240 timesurfer, Apr 21, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)