Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
My computer has gotten into a situation where, whenever I open a Windows Store app or the Windows Store itself, the splash screen appears for a few seconds and then it crashes. I am unable to use any Windows Store apps. Also, I tried many, many different proposed solutions that I found on the internet to no avail.
I methodically followed-up every error log and finally was able to fix this problem.
The problem appears to be widespread based on all the complaints I've seen on the internet.
This has to be one of the most annoying problems I’ve ever faced with Windows. None of the “easy” solutions worked for me, but I dug deep and finally was able to fix this. Here’s how I did it. (Note: As always, I’m not responsible for any damage that may arise from you following my advice.)
Run Powershell as administrator by hitting the start button, typing
“Powershell” then right-clicking “Windows PowerShell” and clicking
“Run as Administrator”.
Try re-installing your Windows Store app by
running the following two commands:
$manifest = (Get-AppxPackage Microsoft.WindowsStore).InstallLocation + '\AppxManifest.xml'
Add-AppxPackage -DisableDevelopmentMode -Register $manifest
If you don’t get any errors, skip to step 14 (lucky you!)
If you do get an error, display the error log. First, you have to
find the code for the error log.
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF6, Package could not be registered. (Exception from HRESULT: 0x80073CF6)
NOTE: For additional information, look for [ActivityId] aaa7357d-bec0-0001-5f4f-a8aac0bed101 in the Event Log or use the command line Get-AppxLog -ActivityID aaa7357d-bec0-0001-5f4f-a8aac0bed101
At line:1 char:1
+ Add-AppxPackage -register "C:\Program Files\WindowsApps\Microsoft.Win ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (C:\Program File...ppxManifest.xml:String) [Add-AppxPackage], IOException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
Look where it says “…use the command line Get-AppxLog…” and then copy and paste everything from Get-AppxLog to the end of the line, as follows:
Get-AppxLog -ActivityID aaa7357d-bec0-0001-5f4f-a8aac0bed101
You will see a lot of output. At the end, you should see the exact reason why the command failed. In my case, it looked like this:
error 0x80070002: Reading manifest from location:
C:\ProgramData\Microsoft\Windows\AppRepository\Microsoft.WindowsStore_11602.1.26.0_neutral_split.scale-125_8wekyb3d8bbwe.xml failed with error: The system cannot find the file specified.
So, it can’t find the XML file that it needs. In this case, we can “cheat” by copying a file that we DO have in place of the file that is missing. First, we have to find an appropriate file that we do have available to us. To do this, go to the directory that stores all the XML files, as follows:
cd C:\ProgramData\Microsoft\Windows\AppRepository
Next, list all the files that start with Microsoft.WindowsStore, as follows:
dir Microsoft.WindowsStore*
The result looks like this:
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 4/30/2016 10:09 AM 31341 Microsoft.WindowsStore_11602.1.26.0_x64__8wekyb3d8bbwe.xml
-a---- 4/30/2016 10:09 AM 28503 Microsoft.WindowsStore_11602.1.264.0_neutral_~_8wekyb3d8bbwe.xml
-a---- 1/29/2016 8:28 PM 28502 Microsoft.WindowsStore_2015.2524.4.0_neutral_~_8wekyb3d8bbwe.xml
-a---- 1/13/2016 9:11 AM 28065 Microsoft.WindowsStore_2015.83.24.0_neutral_~_8wekyb3d8bbwe.xml
-a---- 2/13/2016 11:43 PM 28283 Microsoft.WindowsStore_2016.272.4.0_neutral_~_8wekyb3d8bbwe.xml
-a---- 3/10/2016 9:04 AM 28503 Microsoft.WindowsStore_2016.2913.4.0_neutral_~_8wekyb3d8bbwe.xml
In my case, I had another file that was pretty close to the file that was needed. It had the same version number 11602.1.26.0 as the file that was missing, so I just copied that one.
cp Microsoft.WindowsStore_11602.1.26.0_x64__8wekyb3d8bbwe.xml C:\ProgramData\Microsoft\Windows\AppRepository\Microsoft.WindowsStore_11602.1.26.0_neutral_split.scale-125_8wekyb3d8bbwe.xml
Here I ran into a VERY annoying permissions error, which led me down another rabbit hole. When I tried to copy the file, I got this error:
cp : Access to the path 'C:\ProgramData\Microsoft\Windows\AppRepository\Microsoft.WindowsStore_11602.1.26.0_neutral_split.language-ja_8wekyb3d8bbwe.xml' is denied.
At line:1 char:1
+ cp Microsoft.WindowsStore_11602.1.26.0_x64__8wekyb3d8bbwe.xml C:\Prog ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...ekyb3d8bbwe.xml:FileInfo) [Copy-Item], UnauthorizedAccessException
+ FullyQualifiedErrorId : CopyFileInfoItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.CopyItemCommand
I had to give myself full control over the AppRepository directory in order to be able to write files into it. The standard Security tab on the File Properties dialog box wasn’t working for me, so I installed a PowerShell cmdlet that allows you to change file permissions from inside PowerShell. Follow these instructions to install the cmdlet.
First, you must enable running scripts in your Powershell session,
as follows:
Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted
Next, download the NTFSSecurity.zip file at this URL
https://gallery.technet.microsoft.com/scriptcenter/1abd77a5-9c0b-4a2b-acef-90dbb2b84e85
IMPORTANT: The installation instructions in the URL above neglect an important part of the process. Before you unzip the ZIP file you downloaded, you must first “unblock” it, as follows:
Unblock-File C:\Users\xxxxx\Downloads\NTFSSecurity.zip
Where “xxxxx” above is your user name. If you downloaded the file somewhere else, just enter the full path to the downloaded file. Now that you have unblocked the file, you can then unzip it and install it as per the instructions at the URL above. I unzipped it into this folder:
C:\Users\xxxxx\Documents\WindowsPowerShell\Modules\NTFSSecurity
Then, to install it, I typed:
Import-Module NTFSSecurity
You can now give yourself permissions to the Windows Store folder, as follows:
Add-NTFSAccess -Path C:\ProgramData\Microsoft\Windows\AppRepository -Account JIMSURFACEPRO4\chaos -AccessRights FullControl -AccessType Allow -AppliesTo ThisFolderSubfoldersAndFiles
For -Account you must substitute your own user account. To find your user account, type:
whoami
Now that you have permission to the AppRepository directory, you can try the copy command again:
cp Microsoft.WindowsStore_11602.1.26.0_x64__8wekyb3d8bbwe.xml C:\ProgramData\Microsoft\Windows\AppRepository\Microsoft.WindowsStore_11602.1.26.0_neutral_split.scale-125_8wekyb3d8bbwe.xml
Continue running the command in step 2 (just the second command) and each time it gives you an error, run the Get-AppxLog, find the name of the missing XML file, and copy your existing file to the missing file name (step 12, above).
Eventually, you will stop getting missing file errors. In my case, I began getting different errors, as follows:
error 0x80070005: While processing the request, the system failed to register the windows.stateExtension extension due to the following error: Access is denied.
.
6/5/2016 7:05:32 PM 316 error 0x80070005: Cannot register the request because the following error was encountered during the registration of the windows.stateExtension extension: Access is denied.
You won’t believe this, but I solved this problem by… turning off the Windows Firewall. To do this, hit the start button then type “Firewall” and then click on “Windows Firewall”. In the window that shows up next, Click “Turn Windows Firewall On or Off” and then turn it off for all networks.
I then finally was able to succeed with the command:
Add-AppxPackage -DisableDevelopmentMode -Register $manifest
I checked that Windows Store was working by hitting the start button, typing “Store” and clicking on “Store”. It opened up properly and didn’t crash. Hooray!
Finally, you have to fix all of your remaining apps. You can try this command which automatically re-registers all of your apps. Make sure that the Windows Store is closed when you run this command.
Get-AppxPackage -allusers | foreach {Add-AppxPackage -register "$($_.InstallLocation)\appxmanifest.xml" -DisableDevelopmentMode}
However, in my case, many of the apps still failed and it was mostly due to missing files. Since I noticed that the file names followed a pattern, I was able to write this scary Powershell command that created all the missing files:
Get-AppxPackage -allusers | foreach {$scr = "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_$($_.Architecture)__$($_.PublisherId).xml"; if (Test-Path $scr) { cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_split.language-ja_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_ja-jp_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_zh-cn_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_resources.language-zh-hans_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_resources.scale-125_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_resources.scale-140_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_resources.scale-150_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_resources.language-ja_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_split.language-zh-hans_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_split.scale-100_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_split.scale-125_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_split.scale-150_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_split.scale-140_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_split.scale-200_$($_.PublisherId).xml"; cp $scr "c:\ProgramData\Microsoft\Windows\AppRepository\$($_.Name)_$($_.Version)_neutral_split.scale-180_$($_.PublisherId).xml"; } }
I then re-ran step 17 and most of the apps succeeded.
Finally, open the Windows Store, click on Apps, click the download icon and then check for updates. Install all available updates.
Don’t forget to re-enable your Windows Firewall!!!
If you have any questions, please feel free to comment below! Let me know if this actually helps. As always, I’m not responsible for any damage that may arise from you following my advice.
References
http://www.intowindows.com/how-to-reinstall-store-and-other-preinstalled-apps-in-windows-10/
https://technet.microsoft.com/en-us/library/hh856048.aspx
https://social.technet.microsoft.com/Forums/en-US/35d5669c-a5af-4c14-b3cd-8cdb5c745525/addappxpackage-hresult-0x80073cf6-package-could-not-be-registered-merge-failure-error?forum=win10itprogeneral&prof=required
https://blogs.technet.microsoft.com/heyscriptingguy/2014/11/22/weekend-scripter-use-powershell-to-get-add-and-remove-ntfs-permissions/
https://gallery.technet.microsoft.com/scriptcenter/1abd77a5-9c0b-4a2b-acef-90dbb2b84e85
http://www.askvg.com/guide-how-to-reinstall-all-default-built-in-apps-in-windows-10/
I upgraded from Windows 7 Home 64-bit to Windows 10 Enterprise 64-bit on a 6 year old Dell Inspiron 620. The windows store was partially downloading, then it would stop and give error message. ...05. I tried to download new apps for 3 days and nothing worked (new user account, changing softwaredistribution to softwaredistribution.old, a slew of recommend powershell commands such as Get-AppX, changing permissions on WindowsApps folder, etc, etc.
My other problem was that when I went to Settings, Update and Security, and clicked on Windows Update, the screen was blank, flashes, then the window immediately closed
I finally found a solution that fixed BOTH problems... the repair tool at http://www.tweaking.com/files/setups/tweaking.com_windows_repair_aio_setup.exe Download that file and install it, then reboot to Safe Mode and run it.
I used this free repair tool above and did not run any of the Pre-Repair Steps. I clicked on Repairs-Main and ran everything except #6, #7, #12, #17, #19, #24, #31, #32, #33 because I had no problems with those items.
Now, my Windows Store works fine and so does the Windows Update settings in Settings, Update and Security. I hope this helps someone.
Please people when you finally find a working solution and post it. So many do not.
Related
I have a Windows 10 laptop where no TeX distribution was ever installed before (double-checked for config directories, files, and environment variables).
Wanting to install TeX Live 2021, I followed the full installation guide and also read the Windows-specific warnings. I've now tried several times, following different installation procedures - cleaning up everything (deleting base & user directories, environment variables, etc) before each time - but still don't manage to get a working installation. Before I report a bug at tex-live#tug, I wanted to ask for advice here, in case I'm doing something wrong. Here is what I did, step by step, and the problems I encountered in the process.
1. First I tried running the recommended online installer install-tl-windows.exe. It never got past the screen that tries to contact or load from a repository, even after a 30-min wait. Tried a dozen times, choosing different mirrors nearby and far away. No luck.
2. Then I downloaded and unpacked the install-tl.zip and run install-tl-windows.bat therein. This time the main installation window appeared. I left all default paths and environment variables (note that I do have write access to C:); in the selection scheme I unselected all languages except US & UK English, unselected XeTeX, LuaTeX, ConTeXt; also unselected TeXworks (I use Emacs), and clicked Install. After one to three hours (depending on the mirror I chose), the installation was complete.
I tried compiling a minimal latex document (see below), and got an error similar to the one in this old question:
I can't find the format file `pdflatex.fmt'
Following the advice in the answers to that question and similar questions elsewhere online such as this, I tried running texhash and fmtutil-sys --all. The latter gave the error
no appropriate script or programme found fmtutil.
for which there are also many posts online.
2a. Not understanding what the problem could be, I re-tried with all possible combinations of the following three options: (a) choosing different mirrors; (b) leaving the full selection of packages (ie without unselecting some languages, LuaTeX etc); (c) redoing the procedure by choosing "Run as Administrator". No luck.
3. At this point I tried downloading the ISO file with the full installation. Mounted the image and run install-tl-windows.bat (as normal user, as recommended; I repeat that I do have write access to C:). Everything proceeded as in step 2. above. At the end of the installation I tried running pdflatex on the minimal latex document. New error this time:
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./minimal-template.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
! LaTeX Error: File `article.cls' not found.
Very strange. A file search revealed that article.cls is in the TeXLive file system; but kpathsea did not see it indeed.
4. At this point I opened the TeX Live Shell from the Start Menu; selected a CTAN mirror; updated the TL Manager which was not up to date; updated all packages; run Regenerate filename database; and run Regenerate formats. With the latter I got this error:
tex live shell:
mtutil [INFO]: total formats: 59
fmtutil [INFO]: exiting with status 53
C:\texlive\2021\bin\win32\runscript.tlu:915: command failed with exit code 53:
perl.exe c:\texlive\2021\texmf-dist\scripts\texlive\fmtutil.pl --sys --all
Here is a snip from the full set of errors appearing in the "Other" tab (I'm replacing my user directory with asterisks for privacy; note that I do have write access to these directories):
start load https://www.nic.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet
finish load https://www.nic.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet
start load http://contrib.texlive.info/current
finish load http://contrib.texlive.info/current
running mktexlsr ...
done running mktexlsr.
running mtxrun --generate ...
done running mtxrun --generate.
running updmap-sys ...
done running updmap-sys.
regenerating fmtutil.cnf in C:/texlive/2021/texmf-dist
running fmtutil-sys --byengine luatex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=C:\Users\***\AppData\Local\Temp\rPSb0Dpak2\WW_dJvUHgX ...
tlmgr.pl: fmtutil-sys --byengine luatex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=C:\Users\***\AppData\Local\Temp\rPSb0Dpak2\WW_dJvUHgX failed (status 255), output:
Unknown option: status-file
Try "fmtutil --help" for more information.
C:\texlive\2021\bin\win32\runscript.tlu:915: command failed with exit code 255:
perl.exe c:\texlive\2021\texmf-dist\scripts\texlive\fmtutil.pl --sys --byengine luatex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=C:\Users\***\AppData\Local\Temp\rPSb0Dpak2\WW_dJvUHgX
running fmtutil-sys --byengine luajithbtex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=C:\Users\***\AppData\Local\Temp\rPSb0Dpak2\WW_dJvUHgX ...
I tried to continue anyway with Regenerate fontmaps, and then tried again pdflatex on the minimal document. New error:
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
---! c:/texlive/2021/texmf-var/web2c/pdftex/pdflatex.fmt made by different executable version
(Fatal format file error; I'm stymied)
5. I tried again steps 3. and 4., but with "Run as Administrator". Same errors.
OK at this point I give up and really don't know what to do. Am I doing something wrong? For the moment I have to concur with this post: installation of TeX Live 2021 is an utter failure.
Here is the minimal latex file I used for testing (copy & paste):
\documentclass{article}
\begin{document}
test
\section{Section}
test
\end{document}
Found, that the download is not working because the system path to "cmd.exe" is not found. Therefore: open a cmd window and add the system path prior to starting the .bat file (set PATH=%PATH%;C:\Windows\system32)
This is a common error that is not solved by the common solutions I have found on the internet.
Unable to run Get-PsRepository, Install-Module, and related (OneGet?) commands without them throwing the "Unable to find module providers (PowerShellGet)" error. This appears to be an issue with the NuGet packagemanager module but I do not know how to recover. The package provider installed appears valid
Symptom patterns:
C:> [Net.ServicePointManager]::SecurityProtocol
Tls12
Get-PSRepository
PackageManagement\Get-PackageSource : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4496 char:31
+ ... ckageSources = PackageManagement\Get-PackageSource #PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power...etPackageSource:GetPackageSource) [Get-PackageSource
], Exception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageSource
Register-PSRepository -Default -Verbose
VERBOSE: PowerShell meta provider initialization failed.
VERBOSE: No match was found for the specified search criteria and provider name 'PowerShellGet'. Try
'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.
PackageManagement\Register-PackageSource : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4211 char:17
+ ... $null = PackageManagement\Register-PackageSource #PSBoundParamete ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power...erPackageSource:RegisterPackageSource) [Register-Pac
kageSource], Exception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.RegisterPackageSource
Install-Module PowerShellGet -Force
PackageManagement\Install-Package : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ... $null = PackageManagement\Install-Package #PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
Facts:
Windows 10 (1903)
Powershell 5.1.18362.1171
Running PowerShell as Administrator
Not behind a proxy
Have access to https://www.powershellgallery.com/api/v2
Have access to nuget.org
`[Net.ServicePointManager]::SecurityProtocol = Tls12
FIPS is disabled (HKLM\System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy\Enabled DWORD=0)
Get-PackageProvider shows only NuGet 2.8.5.208
PowerShellGet version is 1.0.0.1 ; when trying force a sxs install with Install-Module PowerShellGet -Force I get the same: PackageManagement\Install-Package : Unable to find module providers (PowerShellGet).
We encountered the same problem. Found this thread without a solution. But I dug a bit further and on the computer that had this problem we found version 1.4.7 of PackageManagement installed.
After removing this folder everything started working normally. I have not found how this thing got installed. Seems like a legit powershell module from Microsoft but it's interacting with the 'normal' PowershellGet module and seems to break it.
For us it was located in the %USERPROFILE%/documents/WindowsPowershell/Modules.
Also worth nothing that this %USERPROFILE% was a corporate OneDrive.
Edit: Microsoft have fixed this issue: https://github.com/PowerShell/vscode-powershell/issues/3432
Not enough Rep to comment.
I ended up in the same situation. A Windows 10 1909 machine, with
%USERPROFILE%/document being a corporate OneDrive. Moving
PackageManagement out of /WindowsPowerShell/ changed
Get-PSRepository's output from nothing to PSGallery. Thanks! – tmcg
Mar 1 at 21:35 This was exactly the same issue. I suspect this is
because PowerShell 7 dumped it into this location (possibly Visual
Studio Code when it prompt to update?) – aolszowka Mar 1 at 22:09
I encountered the same issue with packagemanagement in %USERPROFILE%/documents on my personal profile. The file dates matched when I installed VScode and the Powershell Extensions on this new machine.
Removing the folder from modules corrected the issue for the time being.
In addition to removing %USERPROFILE%/Documents/WindowsPowershell/Modules folder, I also found that putting the package manger locally helped powershell.exe -NoLogo -NoProfile -Command 'Save-Module PackageManagement -MinimumVersion 1.4.7 -LiteralPath ""C:\Program Files\WindowsPowerShell\Modules\""' thanks to itsho here https://github.com/PowerShell/vscode-powershell/issues/2824#issuecomment-750902181
The cause is due to the %USERPROFILE%/Documents folder being on a OneDrive and module-install keeps installing the PackageManagement module to user documents by default ignoring PSModulePath, even had the OneDrive location removed/changed.
This my module path from running PS inside vscode identifying info removed:
$env:PSModulePath -split ';'
C:\Users\{myUsername}\OneDrive - {myCompanyName}\{company}\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
There are more things that can be done to fix this from happening again discussed here https://github.com/PowerShell/PowerShell/issues/15552#issuecomment-1002708799
Like setting the documents folder to local and off OneDrive like shown here https://support.microsoft.com/en-us/topic/configuration-of-the-my-documents-folder-dfd9a90d-8f80-18d6-e7cc-f1566fc3b10b
I followed these steps for now.
In explorer to the left under quick access right click Documents, and then click Properties.
Change to the location tab in the configuration box and type the new path to the Documents folder, I used the local one
Click No so the existing files do not move and still can be accessed by going into OneDrive. I also added another quick access folder for my OneDrive location, but that is up to you.
Note: This effects other programs as well like the default save location for PowerPoint. You'll need to be mindful that you don't save something local thinking it will be backed up to OneDrive.
My module paths after the change:
$env:PSModulePath -split ';'
C:\Users\{myUsername}\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
Another workaround could be to have OneDrive keep the files local.
Navigate to %USERPROFILE%/Documents
Right click WindowsPowershell and select "Always keep on this device".
I haven't been able to test this one, but it might be the least impactful way to address this.
I am trying to register the Windows 10 Edge package with Windows Server 2016. I have successfully installed the store thanks to a forum I found and it opens but remains untested. I am trying to do the same with Edge. I've copied the app package from the installer iso to C:\Windows\systemapps and ran the power shell script:
Add-AppxPackage -register "C:\windows\systemapps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\Appxmanifest.xml" -DisableDevelopmentMode
And get the following error:
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF9, Install failed. Please contact your software vendor.
(Exception from HRESULT: 0x80073CF9)
Rejecting a request to register from Appxmanifest.xml because the manifest is not in the package root.
NOTE: For additional information, look for [ActivityId] a80e1223-2787-0000-dc3e-12a98727d301 in the Event Log or use
the command line Get-AppxLog -ActivityID a80e1223-2787-0000-dc3e-12a98727d301
At line:1 char:1
+ Add-AppxPackage -register "C:\windows\systemapps\Microsoft.MicrosoftE ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (C:\windows\syst...ppxmanifest.xml:String) [Add-AppxPackage], IOException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
I've verified the manifest is in the package root so other than that I can't figure out what it means. Can someone help me understand what it's looking for?
Reference for store install: http://virtualcustoms.net/showthread.php/72904-Install-Microsoft-Store-and-Apps-on-Windows-10-LTSB-2016
I was just trying to do the same thing and I have found if I copy the app to C:\Program Files\WindowsApps then it installs without complaining about not being in the root and then the Edge icon also appears on the start menu.
The command to run is:
Add-AppxPackage -DisableDevelopmentMode -Register "C:\Program Files\WindowsApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AppxManifest.xml"
Whilst this allows the app to install and I am able to launch it from the start menu it closes after about 2 seconds and looking in the log (Application and Service Logs\Microsoft\Windows\Apps\Microsoft-Windows-TWinUI/Operational it shows this error so it looks like there is still something else that needs to be done to get this working:
ActivateApplicationForContractByAppIdAsUserWithHost of the app Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge for the Windows.Launch contract failed with The app didn't start..
Robin
I found it difficult to add to the win apps folder but figured out as long as the location of the apps you want to add are located in a folder named C:\Program Files\WindowsApps* it will work. I use a folder named “WindowsApps-Import” in the programs folder, works well!
One answer suggests adding the -DisableDevelopmentMode flag to the command you've ran, which works, but leaves an important point out.
Once the app installs, it won't run and crashes soon after. This is because the ALL APPLICATION PACKAGES group doesn't have access to the folder of the app. Giving ALL APPLICATION PACKAGES full control of the app folder will allow it to run.
Move the folder inside: "C:\Users$USERNAME\AppData\Local\Packages" then it works. Obv developer mode on windows needs to be ON.
for eg:
Add-AppxPackage -Register "C:\Users\Amit\AppData\Local\Packages\WsaPackage_1.7.32815.0_x64_Release-Nightly\AppxManifest.xml"
We use Inno Setup(version 5.4.2) as the packaging tool to generate our installer. While upgrading our software from older version to current version,
we try to overwrite existing binaries/drivers. This is often leading to issues as some monitoring software like 'HP ArcSight Logger/Connector', 'SplunkUniversalForwarder' etc. are holding file handles on our binaries and casuing overwrite to fail. Our installer shows beolow popup message on encountering this issue each time.
"C:\Windows\System32\drivers\xxx.sys
An error occurred while trying to replace the existing file:
DeleteFile failed; code 5.
Access is denied.
Click Retry to try again, Ignore to skip this file(not recommended), or Abort to cancel installation"
Interestingly, even after above getting above pop-up, we were able to rename xxx.sys to xxx.sys.old manully. We used to suggest cusotmers to rename
xxx.sys to xxx.sys.old and 'Retry' the installation. After renaming, upgrade used to complete without any issues.
Questions
1) Is it possible to rename xxx.sys through program always, when we hit this issue.
2) Any process to reproduce the DeleteFile failed; code 5 issue?
Using the installer you can rename the existing file and install the new file using the correct file name with help from the windows registry.Remember to ask the user to reboot their computer to complete the install.Another option would be to either use the installer to rename the file and again using the window's registry to delete the unneeded file.
Window's registry allows you to delete or rename files on reboot as part of an install.
Reference to use of PendingFileRenameOperations:
http://support.microsoft.com/kb/181345
Example to rename from microsoft support:
The syntax used is (without quotes):
"\??\source file !\??\target file"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Value name: PendingFileRenameOperations Data type : REG_MULTI_SZ
Value data: \??\c:\temp\win32k.sys !\??\c:\winnt\system32\win32k.s
The same command can be used to delete a file as well although requires the use of nulls.
http://www.pcreview.co.uk/forums/pendingfilerenameoperations-delete-file-t1715654.html
Same example used to delete a file:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Value name: PendingFileRenameOperations Data type : REG_MULTI_SZ
Value data: \??\c:\temp\win32k.sys\0\0\0
I hope this helps you!
I can't get windows 8 (release preview) to accept either the inf2cat or makecat approach described as solutions to the question at
What changed in the driver signature requirements for Windows 8?
unless I disable validation.
I am not signing these with any certificates at this point, just trying to get past the errors preventing the drivers from installing at all.
Windows 8 gives me a very nondescript error:
"A problem was encountered while attempting to add the driver to the store."
Looking in the event logs, there is nothing of use; only an informational entry from "Windows Error Reporting" indicating a PnPdriverimporterror.
When i use my original files with the cab files that don't match the inf, I get the error everyone else is listing:
The hash for the file is not present in the specified catalog file.
I have one .inf file that i need to generate a .cat for.
Perhaps I am doing something wrong. Ideas??
INF2CAT Approach
c:\win_xp_vista32_64>inf2cat /driver:"." /os:XP_X86,XP_x64,Vista_X86,Vista_x64,7_X86,7_X64,8_X86,8_X64
.......................
Signability test complete.
Errors:
None
Warnings:
22.9.10: usbser.sys in [drivercopyfiles.nt] is missing from [SourceDisksFiles] s
ection in \mchpcdc.inf; ok if file source is provided via LayoutFile in [Version
].
22.9.10: %driverfilename%.sys in [drivercopyfiles.ntamd64] is missing from [Sour
ceDisksFiles] section in \mchpcdc.inf; ok if file source is provided via LayoutF
ile in [Version].
Catalog generation complete.
c:\win_xp_vista32_64\mchpcdc.cat
MAKECAT approach
--- start of catalog.cdf file---
[CatalogHeader]
Name=mchpcdc.cat
ResultDir=.\
[CatalogFiles]
<hash>mchpcdc=.\mchpcdc.inf
---end of .cdf file ---
c:\win_xp_vista32_64>makecat catalog.cdf
These same files, w/ the cat from either approach install just fine in Windows 7.
I think this problem is to do with "windows driver signing enforcement". You can resolve this by disabling this option. Go through with below link:
http://tivadj-tech.blogspot.in/2012/09/certificate-check-error-when-installing.html
I just tested this on Windows 10 and 8 PRO now, to get this right, follow these steps:
1) From your Start menu, locate your DDK's "x64 Checked Build Environment" i.e. the custom DOS build screen. Right-click, run-as administrator...
2) Compile your source with the Build tools etc.
3) Go into your compiled code, and then create your test-certificate (you don't need to purchase one just yet, use your self-signed one created with the line below):
makecert -r -pe -ss PrivateCertStore -n CN=newhex.com(Test) NewhexTest.cer
The above means your certificate is called "newhex.com(Test)" and the generated file is "NewhexTest.cer"
4) Create / Edit your .CDF file which contains items about what your CAT file's contents.
5) Create your CAT file by executing:
makecat -v MyCDF.CDF
This should generate an un-signed CAT file that includes all files specified by your CDF.
6) Sign your CAT file as follows:
Signtool sign /v /s PrivateCertStore /n newhex.com(test) /t http://timestamp.verisign.com/scripts/timestamp.dll MyDriverWhatever.cat
This should result in a CAT file that is signed, but don't just install it, because your Windows can't trust Newhex's cert since it's not in the keystore, to fix this do:
7) Add your certificate to your private Key Store, remember this step MUST be done by an administrators access, otherwise you will get an error about (Keystore not found etc):
certmgr.exe -add NewhexTest.cer -s -r localMachine root
This should add into your keystore, Once done, you can then:
8) Go into your device manager, and add your new driver, you would get a warning but will be accepted and installed without the need to reboot with a forced (Don't check cert type account).
I tried this already and it works on Windows 10 and Windows 8 pro versions.
Kind Regards
Heider Sati
You are supposed to use inf2cat, not makecat, because you have an INF file.
You should work on addressing those warnings from inf2cat by fixing your INF file. Here is my INF file that uses usbser.sys and doesn't cause any warnings: https://gist.github.com/3647208
I was able to fix my INF file thanks to the advice from chinzei in the first post of this thread: http://www.microchip.com/forums/m488342-print.aspx
If you continue to have trouble, please edit your question to include the source of your INF file, or at least a link to the source.
I encounter the same problem and was able to install my driver with a TEST certificate using the instructions provided here:
http://msdn.microsoft.com/en-us/windows/hardware/gg487328.aspx