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
    #321 timesurfer, Apr 22, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  2. 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...
  3. timesurfer

    timesurfer MDL Developer

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

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #324 timesurfer, Apr 22, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I don't think we need this in Check.bat

    Code:
    If not exist %SystemDrive%\IR6 mkdir %SystemDrive%\IR6 >nul
     
  5. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Curious, do we have a backup check that see's in Check.bat that can tell if theme has been changed since before last 30 days? This way upon restart if user changed theme then it's current theme is backed up not the previous theme

    Think that if user changes his theme/background often the startup backup/restore if user didn't have his comp on for the 30 day task when the theme resets it would be his users latest theme
     
  6. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,699
    210
    #326 Carlos Detweiller, Apr 22, 2013
    Last edited by a moderator: Apr 20, 2017
    The theme name is

    Code:
    "%LOCALAPPDATA%\Microsoft\Windows\Themes\Custom.theme"
    and it appears as "Unsaved theme" in the Customization panel. There's a big issue here:
    Who or what did create it? The user may have changed an element himself/herself and forgotten to save (or (s)he just doesn't care)). Otherwise the Notification eclipse also creates that theme by forcefully blackening out the Wallpaper/Slideshow.
    o_O
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #327 timesurfer, Apr 22, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Do these things have initial dates to do check to apply my idea

    It will just be funny to have user be in notifications and then prior theme/background gets installed but I guess that is better than black background :suicide:

    Thanks for your help

    :shisha:
     
  8. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,699
    210
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,699
    210
    If they didn't save the regkey points to the Custom.theme file - that's what will be backed up. It's the best you can do, the registry doesn't reveal much more. The previous saved themes won't disappear and can be re-selected by the user easily.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    Back up is created at every start up.
    Need some bit of code that checks every day at specific time if previous back up and current theme is the same, if not, run back up code.

    Can I get the latest Duality/Check codes?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Sounds like we just avoid black theme/background which is what my original concept intended

    Thanks guys who all helped with this concept cause it's closed that second loop when dealing with notifications

    Great

    :worthy: Team D420
     
  12. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,699
    210
    As long as Backup never runs in Notification mode, all should be OK.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #334 Humphrey, Apr 22, 2013
    Last edited by a moderator: Apr 20, 2017
    Well, this should handle that.

    Code:
    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
    
    :Backup
    echo %themefile%
    echo %wppath%
    echo %IR6backup%
    echo F | xcopy "%wppath%\TranscodedWallpaper.jpg" /s /q "%IR6backup%" /Y
    echo F | xcopy "%themefile%" /s /q "%IR6backup%\IR6Bkup.theme" /Y
    goto :Exit
    
    :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 :Messagebox
    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
    )
    echo F | xcopy "%IR6backup%\TranscodedWallpaper.jpg" /s /q "%wppath%" /Y
    echo F | xcopy "%IR6backup%\IR6Bkup.theme" /s /q "C:\Windows\resources\Themes" /Y
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes"  /t  REG_SZ /v CurrentTheme /d "C:\Windows\resources\Themes\IR6Bkup.theme" /f >NUL
    %IR6backup%\IR6Bkup.theme
    goto :Exit
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #335 timesurfer, Apr 22, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  15. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,699
    210
    Backup in Notification would be the only edge case where you could accidentally get the Custom.theme with the black background setting in it. If that is excluded now the only time you get a black background backed up is if the user explicitly selected it. Yes, purists exist.
     
    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
    #337 timesurfer, Apr 22, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  17. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,699
    210
    The Windows directory is %windir% or %SystemRoot%, system drive is %SystemDrive%. No need to hardcode C:, I guess.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #339 timesurfer, Apr 22, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  19. 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...