Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Context menu for some extensions is missing #18

Closed
akuropka opened this issue Nov 16, 2021 · 60 comments
Closed

Context menu for some extensions is missing #18

akuropka opened this issue Nov 16, 2021 · 60 comments

Comments

@akuropka
Copy link

akuropka commented Nov 16, 2021

Windows 22000.346

I downloaded the whole set as ZIP (Run-in-Sandbox-master) and extracted it. Afterwards I ran the .\Add_Structure.ps1 which completed without error (running it again without prior remove produces ResourceExists-errors).

The context menu for EXE is there and seems to work. But others are not available... how to track the issue down?

Thank you! (-:

20211116_160939_explorer
20211116_160735_explorer
20211116_160641_explorer
20211116_160825_explorer
20211116_160700_explorer

RunInSandbox_Install.log

@damienvanrobaeys
Copy link
Owner

what is the third extention ? .SVG right ?
You're on Windows 11 ?

@akuropka
Copy link
Author

Yes, it's Windows 11.
I added the install log (Restore point was not created due to one already created recently).

I tried EXE, ISO, ZIP and PS1 (just took any files for testing).

@damienvanrobaeys
Copy link
Owner

ok because i don't see picture for iso i thought you tried on svg file.
Could you please check below locations:
HKCR\Windows.IsoFile\Shell
HKCU.iso
HKCR\CompressedFolder\Shell
HKCR\WinRAR.ZIP\Shell
HKCR.7z
HKCU.ps1

@akuropka
Copy link
Author

akuropka commented Nov 16, 2021

HKCR\Windows.IsoFile\Shell
1.txt

HKCR\.iso
2.txt

HKCR\CompressedFolder\Shell
3.txt

HKCR\WinRAR.ZIP\Shell
does not exist

HKCR\.7z
4.txt

HKCR\.ps1
does not exist

@damienvanrobaeys
Copy link
Owner

Actually it was hkcu for .iso and. Ps1

@akuropka
Copy link
Author

akuropka commented Nov 16, 2021

I was wondering about that but there's nothing like HKCU\..
Screenshot:
20211116_171931_regedit

@damienvanrobaeys
Copy link
Owner

Hkcu > software > classes

@akuropka
Copy link
Author

Ah... HKCU\Software\Classes\.iso and HKCU\Software\Classes\.ps1 do not exist.

@damienvanrobaeys
Copy link
Owner

Regarding the iso part have you installed a tool for iso like CDBurnerXP ?

@akuropka
Copy link
Author

Yes, CDBurnerXP is installed.

@damienvanrobaeys
Copy link
Owner

Ok I thik that's why when you install some soft it may change the way to integrate context menu.
I will proceed step by step, first with ISO.
I will update the add_structure and remove_structure in few minutes. I will inform you

@akuropka
Copy link
Author

top, thx!

@damienvanrobaeys
Copy link
Owner

To be sure could you please check if there is something like as below ?
HKCR\iso-file
OR
HKCR\CDBurnerXP

@akuropka
Copy link
Author

Yes, HKCR\iso-file exists: 5.txt

@damienvanrobaeys
Copy link
Owner

Could you please create a key like "hey hey" in HKCR\iso-file\shell ? not a string just a key
Then do a right-click on an iso, you should see hey hey

@akuropka
Copy link
Author

akuropka commented Nov 16, 2021

Yes, it works.
20211116_205304_regedit
20211116_205100_explorer

@damienvanrobaeys
Copy link
Owner

cool i will update files

@damienvanrobaeys
Copy link
Owner

just updated sources.

You can test as below:
Do a remove-structure.ps1
Download new zip
Run add_structure.ps1

@akuropka
Copy link
Author

Thank you for your efforts.

Unfortunately it did not work.
The logfile did just contain eleven empty lines but there was a console output this time:

[11.17.21 01:42:09] - INFO : Context menus for PS1 have been added
[11.17.21 01:42:11] - INFO : Context menus for REG have been added
[11.17.21 01:42:13] - INFO : Context menu for ISO has been added
[11.17.21 01:42:13] - INFO : Checking content of HKCR.ISO
[11.17.21 01:42:13] - INFO : The key HKCR.ISO exists
[11.17.21 01:42:13] - INFO : Following subkeys found: (default) Content Type
[11.17.21 01:42:13] - INFO : Following property found: iso-file
[11.17.21 01:42:13] - INFO : Reg path to test: \iso-file
[11.17.21 01:42:13] - INFO : The following reg path does not exist: \iso-file
[11.17.21 01:42:13] - INFO : Following property found: CDBurnerXP/iso
[11.17.21 01:42:13] - INFO : Reg path to test: \CDBurnerXP/iso
[11.17.21 01:42:13] - INFO : The following reg path does not exist: \CDBurnerXP/iso
[11.17.21 01:42:15] - INFO : Context menu for PPKG has been added
[11.17.21 01:42:26] - INFO : Context menu for PS1 has been added
[11.17.21 01:42:26] - INFO : Context menus for VBS have been added
[11.17.21 01:42:26] - INFO : Context menus for EXE have been added
[11.17.21 01:42:26] - INFO : Context menu for MSI has been added
[11.17.21 01:42:26] - INFO : Context menu for ZIP has been added
[11.17.21 01:42:30] - INFO : Context menu for 7Z has been added
[11.17.21 01:42:33] - INFO : Context menu for MSIX has been added
[11.17.21 01:42:33] - INFO : Context menu for ISO has been added
[11.17.21 01:42:33] - INFO : Context menus for folder have been added

@damienvanrobaeys
Copy link
Owner

oops seems a bad copy paste in my scripts will change this

@damienvanrobaeys
Copy link
Owner

I just updated the add_structure.ps1 could you please try again ?

@akuropka akuropka changed the title Context menus except for EXE are missing Context menu for some extensions is missing Nov 17, 2021
@akuropka
Copy link
Author

Works great for ISO... 👍😀

@damienvanrobaeys
Copy link
Owner

yeah, now it's not working for PS1, ZIP ? Have you tried msi too ?

@akuropka
Copy link
Author

I was just going through the known extensions:

  • Run EXE ✅
  • Run PS1 ❌ (my default app: MS Powershell ISE)
  • Run ZIP ❌ (my default app: 7-zip)
  • Share folder ✅
  • Run PPKG ✅
  • Run Intunewin ✅
  • Run MSIX ✅
  • Run MSI ✅
  • Run VBS ✅ (incl. run with parameters)
  • Extract ISO ✅
  • Test REG ✅
  • Open HTML ❌ (my default app: Firefox)
  • Install multiple apps ✅ (SDBAPP extension)

@damienvanrobaeys
Copy link
Owner

damienvanrobaeys commented Nov 17, 2021

Could you please check below locations ?
HKCU\software\classes.ps1
HKCU\software\classes\AppXxf01pj590w7z9mxmyv3nx0a9ewj3e51g
HKCR\FirefoxHTML
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.ps1\UserChoice
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.html\UserChoice
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.zip

@akuropka
Copy link
Author

HKCU\software\classes\.ps1
HKCU\software\classes\AppXxf01pj590w7z9mxmyv3nx0a9ewj3e51g ❌, while some other AppX are there
HKCR\FirefoxHTML ❌, but: HKCR\FirefoxHTML-BA1BED273568656F
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1\UserChoice
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.zip

@damienvanrobaeys
Copy link
Owner

For those one below could you please send me a txt file as before ?
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.ps1\UserChoice
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.html\UserChoice
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.zip
HKCR.ps1

@akuropka
Copy link
Author

Sorry... of course: FileExts.txt

HKCR\.ps1
does not exist

@damienvanrobaeys
Copy link
Owner

Thanks
Could you please check below location:
HKCU\software\classes\Applications\powershell_ise.exe

@akuropka
Copy link
Author

Great, thank you again.

@damienvanrobaeys
Copy link
Owner

and if you create a new key like toto in HKCR\7-Zip.zip\shell do you see it when you do a right-click on a zip file ?

@akuropka
Copy link
Author

Yes!
20211122_170936

Btw your script is installing 7-Zip (for own purposes) as well. Maybe it makes sense to check if 7z is already installed and skip copying and using the own one in this case.

@damienvanrobaeys
Copy link
Owner

Actually it doesn't install 7zip just copy required file for extracting iso but nothing is installed on the device

@akuropka
Copy link
Author

Yeah, "installing" by copying to ProgramData and using ist. Just noticed...

@damienvanrobaeys
Copy link
Owner

Just updated sources files.
Could you please try again for zip ?

@akuropka
Copy link
Author

It works... great! 😀👍

Btw I noticed if you extract an iso in the sandbox there's no progress bar. Depending on the size of the iso or the infrastructure used it may take a while until everything is ready.

Another idea coming into my mind was not to extract an iso but to mount it. This should be sufficient since there's no persistent storage anyway.

@damienvanrobaeys
Copy link
Owner

You're right i will add a msgbox when iso is flully extracted.
Yep, actually the second case is in my plan, thanks for the suggestion.
Thanks for your feedback :-)

@akuropka
Copy link
Author

Btw do you have any ☕/🍺 box?

@damienvanrobaeys
Copy link
Owner

You mean something like pay me a coffee on my blog ?

@akuropka
Copy link
Author

Exactly, but didn’t find anything.

@akuropka
Copy link
Author

Maybe something like Custom Context Menu would make things easier... (however, it's for Windows 11 only)

@Joly0
Copy link
Contributor

Joly0 commented Sep 7, 2022

Hey, i have the same (or a similar) issue. Neither HKCU\Software\Classes.ps1 nor HKCU\Software\Classes.iso are there and the context menu option for powershell is missing. I havent tested any other except the app bundle template and exe files, which indeed have the context menu option.
As a side note, i am running windows 10, not windows 11 and the log was overall positive, except the restore point, which couldnt be created (though this isnt an issue)

Edit: Intunewin has the option aswell

@Joly0
Copy link
Contributor

Joly0 commented Sep 7, 2022

.cmd context menu option is missing aswell, .svg works

@orestisthebeast
Copy link

Hi there and thank you for your work. I am also on Windows 10 and can confirm that all context menus apart from .PS1 are working. Any pointers?

@Joly0
Copy link
Contributor

Joly0 commented Apr 19, 2023

Hi there and thank you for your work. I am also on Windows 10 and can confirm that all context menus apart from .PS1 are working. Any pointers?

Hey, i have a fork https://github.com/Joly0/Run-in-Sandbox which i have a pr open aswell (hasnt been merged yet).
I have fixed alot of issues i had with this version, maybe it helps you too. Could you maybe try that and see, if it works? If not, please open an issue over there and i will look into it asap

@orestisthebeast
Copy link

Joly0's fork works on Win10, confirmed.

Thank you so much!

@Joly0
Copy link
Contributor

Joly0 commented Apr 20, 2023

Joly0's fork works on Win10, confirmed.

Thank you so much!

You’re welcome

@ak47uk
Copy link

ak47uk commented May 17, 2023

In case it helps anyone, I could not get this to work with PS1, all other extensions I tested were ok. Notepad++ was set as my default for PS1, I ran Remove_Structure.ps1, reset all default apps in Windows 11, ran Add_Structure.ps1 and then it worked. I got this error on every run, including the successful one and using Joly0 fork:
[05/17/23 15:04:48] - INFO : Checking programs from: Registry::HKEY_USERS\S-1-12-1-...\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1\UserChoice Test-Path : Cannot bind argument to parameter 'Path' because it is null. At C:\Users\USER\Run-in-Sandbox-master\Add_Structure.ps1:296 char:18 + If (Test-Path $HKCR_UserChoice_Shell) { + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand

@Joly0
Copy link
Contributor

Joly0 commented May 17, 2023

In case it helps anyone, I could not get this to work with PS1, all other extensions I tested were ok. Notepad++ was set as my default for PS1, I ran Remove_Structure.ps1, reset all default apps in Windows 11, ran Add_Structure.ps1 and then it worked. I got this error on every run, including the successful one and using Joly0 fork: [05/17/23 15:04:48] - INFO : Checking programs from: Registry::HKEY_USERS\S-1-12-1-...\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1\UserChoice Test-Path : Cannot bind argument to parameter 'Path' because it is null. At C:\Users\USER\Run-in-Sandbox-master\Add_Structure.ps1:296 char:18 + If (Test-Path $HKCR_UserChoice_Shell) { + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand

I think i have fixed this, opened a pr for it

@ak47uk
Copy link

ak47uk commented May 18, 2023

I think i have fixed this, opened a pr for it

That works now, many thanks!

Joly0 added a commit to Joly0/Run-in-Sandbox that referenced this issue Jun 1, 2023
@damienvanrobaeys
Copy link
Owner

Could ou please try with the new version ?

@ak47uk
Copy link

ak47uk commented Jun 6, 2023

Could ou please try with the new version ?

Looking good now, thanks

@damienvanrobaeys
Copy link
Owner

thanks :-)

Joly0 added a commit to Joly0/Run-in-Sandbox that referenced this issue Jul 10, 2023
Joly0 added a commit to Joly0/Run-in-Sandbox that referenced this issue Aug 26, 2024
Joly0 added a commit to Joly0/Run-in-Sandbox that referenced this issue Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants