Disassembler0 / Win10-Initial-Setup-Script

PowerShell script for automation of routine tasks done after fresh installations of Windows 10 / Server 2016 / Server 2019
MIT License
4.69k stars 1.08k forks source link

Windows Store appllication. #265

Closed Payasonic closed 4 years ago

Payasonic commented 4 years ago

Hi there, I used your script and i accidentally deleted WindowsStore, next time i tried to use script with option to install WindowsStore it did nothing. Any help would be appreciated.

Disassembler0 commented 4 years ago

I've just tried on VM, to be sure, and it works, provided you didn't forget to include admin elevation and haven't used any other tweaking tools (some of which remove the AppX package completely).

Open regular command line (cmd), navigate to the directory with the script and run

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Win10.ps1" -include "%~dp0Win10.psm1" RequireAdmin InstallWindowsStore

If that doesn't work, get an elevated PowerShell (run as admin), run the following and paste all the output here.

Get-AppxPackage -AllUsers "Microsoft.DesktopAppInstaller" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Microsoft.Services.Store.Engagement" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Microsoft.StorePurchaseApp" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Microsoft.WindowsStore" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Payasonic commented 4 years ago

hello there, thank you for the fast response.

First i tried to do it with the cmd and i got this message: The argument '%~dp0Win10.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.

when i tried to do the second thing in PowerShell as an admin it did nothing.

once again, thank you very much for helping me.

On Wed, 18 Sep 2019 at 17:51, Disassembler0 notifications@github.com wrote:

I've just tried on VM, to be sure, and it works, provided you didn't forget to include admin elevation and haven't used any other tweaking tools (some of which remove the AppX package completely).

Open regular command line (cmd), navigate to the directory with the script and run

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Win10.ps1" -include "%~dp0Win10.psm1" RequireAdmin InstallWindowsStore

If that doesn't work, get an elevated PowerShell (run as admin), run the following and paste all the output here.

Get-AppxPackage -AllUsers "Microsoft.DesktopAppInstaller" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($.InstallLocation)\AppXManifest.xml"} Get-AppxPackage -AllUsers "Microsoft.Services.Store.Engagement" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($.InstallLocation)\AppXManifest.xml"} Get-AppxPackage -AllUsers "Microsoft.StorePurchaseApp" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($.InstallLocation)\AppXManifest.xml"} Get-AppxPackage -AllUsers "Microsoft.WindowsStore" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($.InstallLocation)\AppXManifest.xml"}

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/265?email_source=notifications&email_token=ANHMWCSXS32JCMPBI3QFBILQKJE6LA5CNFSM4IYALYRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ARK2A#issuecomment-532747624, or mute the thread https://github.com/notifications/unsubscribe-auth/ANHMWCXFKI4LPJHKJHWMFQLQKJE6LANCNFSM4IYALYRA .

Payasonic commented 4 years ago

To be honest i just run the script when i downloaded it and later on i figured out some things should be excluded.

On Wed, 18 Sep 2019 at 18:23, Josip Pajic rotkvica1337@gmail.com wrote:

hello there, thank you for the fast response.

First i tried to do it with the cmd and i got this message: The argument '%~dp0Win10.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.

when i tried to do the second thing in PowerShell as an admin it did nothing.

once again, thank you very much for helping me.

On Wed, 18 Sep 2019 at 17:51, Disassembler0 notifications@github.com wrote:

I've just tried on VM, to be sure, and it works, provided you didn't forget to include admin elevation and haven't used any other tweaking tools (some of which remove the AppX package completely).

Open regular command line (cmd), navigate to the directory with the script and run

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Win10.ps1" -include "%~dp0Win10.psm1" RequireAdmin InstallWindowsStore

If that doesn't work, get an elevated PowerShell (run as admin), run the following and paste all the output here.

Get-AppxPackage -AllUsers "Microsoft.DesktopAppInstaller" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($.InstallLocation)\AppXManifest.xml"} Get-AppxPackage -AllUsers "Microsoft.Services.Store.Engagement" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($.InstallLocation)\AppXManifest.xml"} Get-AppxPackage -AllUsers "Microsoft.StorePurchaseApp" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($.InstallLocation)\AppXManifest.xml"} Get-AppxPackage -AllUsers "Microsoft.WindowsStore" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($.InstallLocation)\AppXManifest.xml"}

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/265?email_source=notifications&email_token=ANHMWCSXS32JCMPBI3QFBILQKJE6LA5CNFSM4IYALYRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ARK2A#issuecomment-532747624, or mute the thread https://github.com/notifications/unsubscribe-auth/ANHMWCXFKI4LPJHKJHWMFQLQKJE6LANCNFSM4IYALYRA .

Payasonic commented 4 years ago

I have deleted ~dp0 from the Win10 lines and managed to get to powershell message which says installing windows store but i still can't find it.

Disassembler0 commented 4 years ago

The tweak for Windows Store removal is excluded by default, so if you haven't manually uncommented UninstallWindowsStore in Default.preset, then it wasn't this script what uninstalled Windows Store.

1) When you say "it did nothing", did it at least briefly show the progress bar on the top of the powershell window? Like this store

2) Try opening Run prompt (either via right-clicking on Start Menu or via Win+R keyboard shortcut) and run

    ms-windows-store:
It should either launch the Store or give you an error message "You'll need a new app to open this ms-windows-store link". Let me know what was the result.

3) Please run following command from elevated PowerShell and pase the output

    Get-AppxPackage -AllUsers "Microsoft.WindowsStore"
Payasonic commented 4 years ago

Ok, so i saw those commands on internet and used them, once it showed that progress bar, while most of the times it did not. 2.windows cannot find ms-windows-store. Make sure you typed the name correctly...

  1. when i run that command it just moves to a new line to type in a command.

Strange i know :(

On Wed, 18 Sep 2019 at 18:37, Disassembler0 notifications@github.com wrote:

The tweak for Windows Store removal is excluded by default, so if you haven't manually uncommented UninstallWindowsStore in Default.preset, then it wasn't this script what uninstalled Windows Store.

1.

When you say "it did nothing", did it at least briefly show the progress bar on the top of the powershell window? Like this [image: store] https://user-images.githubusercontent.com/5568046/65167213-66dd8100-da42-11e9-97d7-b29601dd56be.png 2.

Try opening Run prompt (either via right-clicking on Start Menu or via Win+R keyboard shortcut) and run

ms-windows-store:

It should either launch the Store or give you an error message "You'll need a new app to open this ms-windows-store link". Let me know what was the result. 3.

Please run following command from elevated PowerShell and pase the output

Get-AppxPackage -AllUsers "Microsoft.WindowsStore"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/265?email_source=notifications&email_token=ANHMWCQ4I62B336GWNTEFTLQKJKOHA5CNFSM4IYALYRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7AV3AA#issuecomment-532766080, or mute the thread https://github.com/notifications/unsubscribe-auth/ANHMWCSCESGJ66ARCJVEUC3QKJKOHANCNFSM4IYALYRA .

Payasonic commented 4 years ago

OS Name Microsoft Windows 10 Enterprise LTSC Version 10.0.17763 Build 17763 dont know if it might be useful.

Might be that i also corrupted my profile.

Disassembler0 commented 4 years ago
  1. when i run that command it just moves to a new line to type in a command.

Yeah, so this tells us it definitely wasn't caused by the script. Even though there were several attempts (#130, #165, #239, #243) to add tweaks which would uninstall AppX packages for good, your case is the exact reason why I have never added them so far. Because such modifications can't be easily reverted.

There is a rough outline what to do in case something like this happens in my script here: https://github.com/Disassembler0/Win10-Initial-Setup-Script/blob/91a6afba1fd78e07c54a89518f31c633598568c0/Win10.psm1#L2999-L3004 However it requires an installation media and some skills and insight into what you're about to do, because the comments are really just a general guidance.

There's also answered question about the same on superuser.com, but this solution also requires another source of files (another PC or a virtual machine) you need to copy.

Payasonic commented 4 years ago

Thanks very much for the answer! I feared it would come to this, I'll see what i can do with this WindowsApps, etc. and hopefully will bring to a working condition again :)

Payasonic commented 4 years ago

I'm exactly missing Windows Store app in my WindowApps folder.

Payasonic commented 4 years ago

I managed to get the Windows Store app back with a help of superuser.com and most importantly your help!

Thanks a million!