Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to save shortcut #3489

Closed
DancingQuanta opened this issue May 31, 2019 · 4 comments · Fixed by #5031
Closed

Unable to save shortcut #3489

DancingQuanta opened this issue May 31, 2019 · 4 comments · Fixed by #5031

Comments

@DancingQuanta
Copy link

I am having issues installing scoop apps on a windows 7 PC at a place of employment.
However my PC was set up in a weird way with respect to the networked drives.
As a result this prevented scoop from installing shortcuts to Start Menu because Start Menu is located on a networked drive in my user domain and this operation used badly formatted path for shortcuts. As far as I can tell the programs always installs on the local drive.

For an example of installing git

PS C:\Users\at17> scoop install git
Scoop uses Git to update itself. Run 'scoop install git' and try again.
Installing '7zip' (19.00) [64bit]
7z1900-x64.msi (1.7 MB) [=====================================================================================] 100%
Checking hash of 7z1900-x64.msi ... ok.
Extracting 7z1900-x64.msi ... done.
Linking ~\scoop\apps\7zip\current => ~\scoop\apps\7zip\19.00
Creating shim for '7z'.
ForEach-Object : Unable to save shortcut
"C:\Users\at17\Microsoft.PowerShell.Core\FileSystem::\fpsvr2\users7$\at17\Start Menu\Programs\Scoop Apps\7-Zip.lnk".
At C:\Users\at17\scoop\apps\scoop\current\lib\shortcuts.ps1:4 char:50
+     $shortcuts | Where-Object { $_ -ne $null } | ForEach-Object {
+                                                  ~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [ForEach-Object], FileNotFoundException
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ForEachObjectCommand

My Start Menu is located in a networked drive that should begin with \\fpsvr2 however the error shows that \fpsvr2 was used instead. This path configuration is called UNC.

I am able to navigate to the Start Menu

PS C:\Users\at17> cd \\fpsvr2\users7$\at17\"Start Menu"\Programs
PS Microsoft.PowerShell.Core\FileSystem::\\fpsvr2\users7$\at17\Start Menu\Programs>

You can see in the destination directory that Microsoft.PowerShell.Core\FileSystem precludes the UNC path as shown in the error above.

Proposed solutions;

  • Move Start Menu - I need to ask my IT dept to do this and there is no guarantee this will happen.
  • Fix UNC path handling. The dropping of backslash needs to be fixed.
  • Option to ignore making shortcuts in Start Menu. I have no idea how important is Start Menu to operation of scoop. But this is a user facing feature and I have little use for this.
cyingfan added a commit to cyingfan/scoop that referenced this issue Jul 16, 2021
Calls Convert-Path on Filesystem object (returned `by shortcut_folder()`) so it works on start menu mounted on network drive
ScoopInstaller#3489
@dwettstein
Copy link

Additionally, when this happens Scoop marks the app as git *failed* and you need to force update or uninstall afterwards.
IMO, Scoop should not mark them as failed just because creating the shortcut failed. The app itself is installed and working properly.

@Ash258, as an idea, maybe this is something you could fix in your fork https://github.com/Ash258/Scoop-Core?

@dwettstein
Copy link

Hey @rashil2000. Why have you closed that issue, has it been fixed recently?

@rashil2000
Copy link
Member

Closed by mistake, I apologize. I had too many tabs open, must have mixed up...

@rashil2000 rashil2000 reopened this Jan 7, 2022
@dwettstein
Copy link

Closed by mistake, I apologize. I had too many tabs open, must have mixed up...

No worries, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants