[GUIDE] Add Store to Windows 10 EnterpriseS SKU (LTSB/LTSC)

Discussion in 'Windows 10' started by Tito, Aug 9, 2016.

  1. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    #121 GOD666, Aug 10, 2016
    Last edited by a moderator: Apr 20, 2017
    For the sake of argument, I'll stick with

    Code:
    %SYSTEMDRIVE%\Program Files\WindowsApps
     
  2. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120
    It indeed works (the store is installed). But the batch fails to set correctly the permissions and ownership as intended
     
  3. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    #123 GOD666, Aug 10, 2016
    Last edited by a moderator: Apr 20, 2017
    Final code for that will be

    Code:
    @REM [This code block detects if the script is running with ADMIN PRIVILEGES. If it isn't it pauses, and then quits.]echo OFF
    cls
    NET SESSION >nul 2>&1
    IF %ERRORLEVEL% EQU 0 (
        ECHO Administrator PRIVILEGES Detected! 
    ) ELSE (
       echo ######## ########  ########   #######  ########  
       echo ##       ##     ## ##     ## ##     ## ##     ## 
       echo ##       ##     ## ##     ## ##     ## ##     ## 
       echo ######   ########  ########  ##     ## ########  
       echo ##       ##   ##   ##   ##   ##     ## ##   ##   
       echo ##       ##    ##  ##    ##  ##     ## ##    ##  
       echo ######## ##     ## ##     ##  #######  ##     ## 
       echo.
       echo.
       echo ####### ERROR: ADMINISTRATOR PRIVILEGES REQUIRED #########
       echo This script must be run as administrator to work properly!  
       echo If you are seeing this right click on All_In_One.CMD and select "Run As Administrator."
       echo ##########################################################
       echo.
       PAUSE
       EXIT /B 1
    )
    @echo ON
    
    
    %~d0
    cd %~d0%~p0
    cls
    regedit.exe /S Files\regedit1.reg
    regedit.exe /S Files\regedit2.regS
    takeown /F "%SYSTEMDRIVE%\Program Files\WindowsApps"
    icacls "%SYSTEMDRIVE%\Program Files\WindowsApps" /grant "Everyone":F
    xcopy Files\store_depends_from_enterprise "%SYSTEMDRIVE%\Program Files\WindowsApps\"  /e /i /h /y /k /o /x
    powershell "& "".\Files\StoreDependencies.ps1"""
    icacls "%SYSTEMDRIVE%\Program Files\WindowsApps" /grant "ALL APPLICATION PACKAGES":F
    icacls "%SYSTEMDRIVE%\Program Files\WindowsApps" /grant "Trusted Installer":F
    icacls "%SYSTEMDRIVE%\Program Files\WindowsApps" /grant "System":F
    
    
    pause
     
  4. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120
    #124 T-S, Aug 10, 2016
    Last edited by a moderator: Apr 20, 2017

    %ProgramFiles%\WindowsApps


    Is more correct/elegant.

    You can have your windows in C:\ and have the \program files directory elsewhere.

    Not a so common scenario but in such case %SYSTEMDRIVE%\Program Files\ wold be wrong
     
  5. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    #125 GOD666, Aug 10, 2016
    Last edited by a moderator: Apr 20, 2017
    Coding for Windows vs Linux. :eek:

    Q: Is this trailing slash required or a problem? :confused:

    Code:
    xcopy Files\store_depends_from_enterprise "%SYSTEMDRIVE%\Program Files\WindowsApps\"  /e /i /h /y /k /o /x
    vs
    Code:
    xcopy Files\store_depends_from_enterprise "%SYSTEMDRIVE%\Program Files\WindowsApps"  /e /i /h /y /k /o /x
    The ending of WindowsApp with or without \

    Just want to be sure. :eek:
     
  6. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,262
    1,732
    120
    One more code change IMPORTANT!!! CHANGE icacls "%PROGRAMFILES%\WindowsApps" /grant "Trusted Installer":F TO icacls "%PROGRAMFILES%\WindowsApps" /grant "NT Service\TrustedInstaller":F
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    #127 GOD666, Aug 10, 2016
    Last edited by a moderator: Apr 20, 2017
    Alright, new code, before I re-upload this. For review

    Code:
    @REM [This code block detects if the script is running with ADMIN PRIVILEGES. If it isn't it pauses, and then quits.]echo OFF
    cls
    NET SESSION >nul 2>&1
    IF %ERRORLEVEL% EQU 0 (
        ECHO Administrator PRIVILEGES Detected! 
    ) ELSE (
       echo ######## ########  ########   #######  ########  
       echo ##       ##     ## ##     ## ##     ## ##     ## 
       echo ##       ##     ## ##     ## ##     ## ##     ## 
       echo ######   ########  ########  ##     ## ########  
       echo ##       ##   ##   ##   ##   ##     ## ##   ##   
       echo ##       ##    ##  ##    ##  ##     ## ##    ##  
       echo ######## ##     ## ##     ##  #######  ##     ## 
       echo.
       echo.
       echo ####### ERROR: ADMINISTRATOR PRIVILEGES REQUIRED #########
       echo This script must be run as administrator to work properly!  
       echo If you are seeing this right click on All_In_One.CMD and select "Run As Administrator."
       echo ##########################################################
       echo.
       PAUSE
       EXIT /B 1
    )
    @echo ON
    
    
    
    
    %~d0
    cd %~d0%~p0
    cls
    regedit.exe /S Files\regedit1.reg
    regedit.exe /S Files\regedit2.regS
    takeown /F "%ProgramFiles%\WindowsApps"
    icacls "%ProgramFiles%\WindowsApps" /grant "Everyone":F
    xcopy Files\store_depends_from_enterprise "%ProgramFiles%\WindowsApps\"  /e /i /h /y /k /o /x
    powershell "& "".\Files\StoreDependencies.ps1"""
    icacls "%ProgramFiles%\WindowsApps" /grant "ALL APPLICATION PACKAGES":F
    icacls "%ProgramFiles%\WindowsApps" /grant "NT SERVICE\TrustedInstaller":F
    icacls "%ProgramFiles%\WindowsApps" /grant "System":F
    
    
    
    
    pause
     
  8. petok

    petok MDL Senior Member

    May 4, 2009
    342
    187
    10
    Is possible this do work with pack .appxbundle installation with script from MultiLang_App_Update_X21-12056.ISO files ?
     
  9. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,262
    1,732
    120
    #129 dhjohns, Aug 10, 2016
    Last edited by a moderator: Apr 20, 2017
    This script returns NO errors! :worthy:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. RobertJ

    RobertJ MDL Senior Member

    Apr 4, 2014
    318
    79
    10
    Read the thread fully. Full inu mentioned it first and lucidus has already confirmed that this method works too (and IMO is far simpler than copying folders and setting permissions).
     
  11. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,262
    1,732
    120
    Is everyone trying this on LTSB 2016? Has anyone tried it on LTSB 2015 (10240?)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    NO. :p

    Completely different project (and I suspect more work too).

    The goal was to have a minimal install copy of Windows 10 without having to hack away (remove) all the junk found in Windows 10. But to be able to add your own via the store.

    I only included Xbox as an option because, upon further reflection, it too may be needed (games via store). But I also kept it only as an option because I knew some folks may not require it.



    Interesting point.... Edge is not located in Programs Files\WindowsApps
    But if you feel strongly about it, I encourage you to start your own project in your own thread. :p
     
  13. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120


    I'm afraid is not that easy.

    First problem, well known to WMC users, is that the MS genius translated some account names "network service" is "servizio di rete" in italian, and it changes for most of the languages

    The same applies to ALL APPLICATION PACKAGES, so that line fails everywhere except english windows.
     
  14. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,262
    1,732
    120
    #134 dhjohns, Aug 10, 2016
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    1. Updated post 1
    2. Updated mirror
    3. Added new dependencies for optional xBox

    :cool:
     
  16. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    #136 GOD666, Aug 10, 2016
    Last edited by a moderator: Apr 20, 2017
  17. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    As these are packages from an English distro, would that not hold true regardless? And if not, what method can be applied to correct it?
     
  18. RobertJ

    RobertJ MDL Senior Member

    Apr 4, 2014
    318
    79
    10
    Not sure, but if you use the appx and appxbundle files from that multi-lang ISO Full inu and lucidus mentioned, will they not have all the language versions inside?

    Also, any reason you aren't using those anyway? It would certainly make the process much simpler as far as I can tell, with no fiddling with permissions required.
     
  19. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120

    What count is how actually the user(s) is/are called on the windows you're using. "Trusted Installer" isn't translated, some other names are.

    There are a number of workarounds involving the use of the SID instead of the username, none of them are straightforward anyway.

    As I said the best way is to use nsudo and not mess with the permissions at all, see the WMC code.
     
  20. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,957
    2,057
    60
    Assume I'm a Linux user and Windows is this weird thing that I occasionally play with or end up fixing when other folks break it. Which means I'm not 100% sure what you're talking about. Also, I'm pretty sure the ISO I'm playing with isn't multi-lang.

    Regardless, this whole point of this project is so that other folks don't need to play with another ISO. But if you're thinking of another way in which I can improve upon all of this and make it easier for folks, please, do explain.