damienvanrobaeys / Run-in-Sandbox

Run PS1, VBS, CMD, EXE, MSI, Intunewin, MSIX, or extract ISO, ZIP in Windows Sandbox very quickly just from a right-click
https://www.systanddeploy.com/2023/06/runinsandbox-quick-way-to-runextract.html
740 stars 83 forks source link

Windows 11 #16

Closed anl-do closed 2 years ago

anl-do commented 2 years ago

😢 When will RiS run on Windows 11? I can't live without it anymore.

best regards Andreas

damienvanrobaeys commented 2 years ago

Hi,

I haven't tested w11 yet. Have you already tested runinsandbox on it ?

anl-do commented 2 years ago

I have upgraded my PC from 10 to 11. RiS was installed perviously and working fine. After the udate, the context menues are not visible anymore. However, the sandbox is still enabled in Win11. When I run "Add_Structure.ps1" in Win11, the powershell is stuck. image

The log file says: [10.06.21 14:46:42] - INFO : Starting the configuration of RunInSandbox [10.06.21 14:46:42] - INFO : The script has been launched with admin rights [10.06.21 14:46:43] - INFO : The sources folder exists

[10.06.21 14:46:43] - SUCCESS : Sources have been copied in C:\ProgramData\Run_in_Sandbox [10.06.21 14:46:43] - SUCCESS : Sources files have been unblocked [10.06.21 14:46:43] - INFO : Mapping registry HKCR [10.06.21 14:46:43] - SUCCESS : Mapping registry HKCR [10.06.21 14:46:43] - INFO : Exporting registry path: exefile

Even after minutes, there is no further progress. I'm not a powershell expert. How can I debug? I can't see what exactly the script is trying to do when there is no progress. Sorry, I'm no real help :-(

damienvanrobaeys commented 2 years ago

No worries :-) Could you please check below registry key ? Is there Run PS1 in Sandbox ? HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell

anl-do commented 2 years ago

The hive is completely empty. image

damienvanrobaeys commented 2 years ago

Which version did you test meaning when have you downloaded ris ?

anl-do commented 2 years ago

I have downloaded the latest package this morning. The timestamps of the files are these: image

The package that was previously installed in Win 10, I have still in my downloads. It was this timestamp: image

anl-do commented 2 years ago

I have not tried the "old" package yet. What do you think? Shall I try?

damienvanrobaeys commented 2 years ago

nope, i will install a W11 tonight and try it. I will send you a version tomorrow

anl-do commented 2 years ago

That sounds awesome! I really love it and cannot work without ris 😊. If you need anything from me, just let me know. I wished I was a powershell wizard like you...and David Segura and Nickolaj Andersen and and and... THANKS A LOT

damienvanrobaeys commented 2 years ago

You're welcome, thx for the kind words, really appreciate. Could you please test this version by running Add_Structure_test.ps1 ? https://github.com/damienvanrobaeys/RunInSandbix_Dev

anl-do commented 2 years ago

Hi Damien, I have tried the DEV version. This one installs without issues. image

Not all context menus work like expected:

Hopefully, my tests will help you at least a little. I'm here for more tests. Use me like your labourer 😂. As far as I'm concerned, this is now all I need for most of my usecases. On the other hand, I'm very interested in the code itself and which sections you edit. Maybe I can improve my skills a little...

damienvanrobaeys commented 2 years ago

Thanks for the nice feedback. I just noticed the behavior for ps1 this morning. I will work on that

damienvanrobaeys commented 2 years ago

Could you plz send me a mail at damien.vanrobaeys@gmail.com ?

anl-do commented 2 years ago

Have you received my email?

damienvanrobaeys commented 2 years ago

Yep thanks

oMadMartigaNo commented 2 years ago

I really appreciate that you are working on this problem @damienvanrobaeys Thanks!

damienvanrobaeys commented 2 years ago

Have you received my email?

Actually i didn't receive it, it was the notification mail from github lol

damienvanrobaeys commented 2 years ago

Hi Damien, I have tried the DEV version. This one installs without issues. image

Not all context menus work like expected:

  • the .PS1 context menu does not appear at all image
  • the .intunewin part redirects all files and folders, where the selected intunewin file is located, to the sandbox image image
  • the command for the intunewin file is not executed in the sandbox (I have no screenshot for that)
  • the MSI works fine
  • the "extract the ZIP in sandbox" produces an error image
  • the Regkey part works as expected
  • the VBS part also works as expected

Hopefully, my tests will help you at least a little. I'm here for more tests. Use me like your labourer 😂. As far as I'm concerned, this is now all I need for most of my usecases. On the other hand, I'm very interested in the code itself and which sections you edit. Maybe I can improve my skills a little...

Regarding the zip and intunexi part what was the full path of those files ?

anl-do commented 2 years ago

I have kicked the ZIP file of a synced Teams folder, when the error occured. C:\Users\AndreasLandry\Blablabla Group\Rollout Locations- MEM Intune - (IFUSA) Blablabla LLC - All locations - (IFUSA) Blablabla LLC - All locations\Apps\Packages

Hearing you asking the question, I have now tried a simple ZIP-file from drive D:\ (USB Disk). That works properly. Path length?

The intunewin files, I have tested with, are also directly on drive D:\ RiS seems to present everything in the root of Drive D in the sandbox.

HarmVeenstra commented 2 years ago

I'm trying the Dev version now also, I wanted to demo something to a customer and then realized myself.. What if it doesn't work anymore in Windows 11??! :( And it didn't, it did place the intune directory on the desktop though and I could explain the process of testing packages that way but I need this to work again :)

And yes, install.intunewin package works! But..

Run PS1, VBS, EXE, MSI in the Sandbox - Does't work / Not in menu Extract ZIP directly in the Sandbox - Works Share a specific folder in the Sandbox - Works

damienvanrobaeys commented 2 years ago

On my W11 VM EXE, VBS, MSI, ZIP, intunewin work. Have you go into more options as it's something new in Windows 11 (a light context menu). For PowerShell this is a bug I think in W11, I already created a feedback hub.

The intunewin part didn't work for you ?

HarmVeenstra commented 2 years ago

Don't see the option in the sub-context menu, I did a remove and Add_Structure_test.ps1 again and still the same, intunewin does work and also ZIp extract and share folder. Only run ps1, vb1, exe, msi doesn't because the option is not here

damienvanrobaeys commented 2 years ago

Could you please try with the prod version and not dev ? You need to do a remove structure first.

HarmVeenstra commented 2 years ago

Ok, did a remove and used the prod version again. And everything works except .ps1 and .cmd files, vbs/msi/exe do work. Intunewin package, zip, share also work

damienvanrobaeys commented 2 years ago

Cooooool Thanks Yes for ps1 this is a w11 bug i think. I will try to solve that by myself or wait for MS

HarmVeenstra commented 2 years ago

PS1 and cmd in W11? Hope you can solve it or that MS can shine some light :)

damienvanrobaeys commented 2 years ago

Yep see my tweet below

https://twitter.com/syst_and_deploy/status/1447473525586022406?t=AyYY-oxHxDGEpDZBL2RdiA&s=19

damienvanrobaeys commented 2 years ago

I found something interesting. I am now able to create a conext menu for PS1. I will update the runinsandox on Tuesday and will add also some new features:

HarmVeenstra commented 2 years ago

Yes! Works, context-menu is there for everything.. Except.. For PS1 files, it gave me the error in the screenshot. I did a remove_structure before using the new version, did a remove_structure in the new version just to be sure afterwards and added it again with add_structure. No difference

image

damienvanrobaeys commented 2 years ago

What do you have in this key ? image

HarmVeenstra commented 2 years ago

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes.ps1]

[HKEY_CURRENT_USER\Software\Classes.ps1\OpenWithProgids] "VSCode.ps1"="" "AppXxf01pj590w7z9mxmyv3nx0a9ewj3e51g"=hex(0):

damienvanrobaeys commented 2 years ago

no rOpenWithProgids ?

HarmVeenstra commented 2 years ago

Correct, this is the complete export from [HKEY_CURRENT_USER\Software\Classes.ps1]

damienvanrobaeys commented 2 years ago

ok, i will update the add_structure.ps1 in few minutes and will inform you when you can test

HarmVeenstra commented 2 years ago

Thank you!

damienvanrobaeys commented 2 years ago

Could you please download again sources and try again ?

HarmVeenstra commented 2 years ago

Still the same, value $Get_rOpenWithProgids_Default_Value is not set because (Get-Item "$Default_PS1_HKCU\rOpenWithProgids").Property fails. I don't have the rOpwnWithProgids value and it's not created by the script itself. Perhaps a detect and create if not exist?

damienvanrobaeys commented 2 years ago

and if you check in the registry for OpenWithProgids ?

HarmVeenstra commented 2 years ago

image

damienvanrobaeys commented 2 years ago

and if you go in the classes\vscode.ps1\shell ?

HarmVeenstra commented 2 years ago

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\VSCode.ps1] @="PowerShell Source File" "AppUserModelID"="Microsoft.VisualStudioCode"

[HKEY_CURRENT_USER\Software\Classes\VSCode.ps1\DefaultIcon] @="C:\Users\HarmV\AppData\Local\Programs\Microsoft VS Code\resources\app\resources\win32\powershell.ico"

[HKEY_CURRENT_USER\Software\Classes\VSCode.ps1\shell]

[HKEY_CURRENT_USER\Software\Classes\VSCode.ps1\shell\open] "Icon"="\"C:\Users\HarmV\AppData\Local\Programs\Microsoft VS Code\Code.exe\""

[HKEY_CURRENT_USER\Software\Classes\VSCode.ps1\shell\open\command] @="\"C:\Users\HarmV\AppData\Local\Programs\Microsoft VS Code\Code.exe\" \"%1\""

damienvanrobaeys commented 2 years ago

ok i think i found why, you have another dword that i don't have

HarmVeenstra commented 2 years ago

Ok, my laptop is pretty standard I guess using Powershell 5 and 7 in conjunction with VScode ;)

damienvanrobaeys commented 2 years ago

could you please do a remove_structure, download again and try again ?

HarmVeenstra commented 2 years ago

image

It works!

damienvanrobaeys commented 2 years ago

yihaaa, thanks for the feedback, that was really interesting

HarmVeenstra commented 2 years ago

No problem, glad to help and your tool is very usefull!

anl-do commented 2 years ago

Damiehen :-)? I'm not sure, but the context menus in Win10 and Win11 are configured in different places, right? Will there be two RiS versions for 10 and 11 or will you create a super duper operating system recognition into the script to have it all in one?

damienvanrobaeys commented 2 years ago

You're right I am checking if device is w10 or 11 and then check location but it seems for some other reason some context menu may not work on some w11. Do you have some issues ?

anl-do commented 2 years ago

I have not yet tested all. If you agree, I'd close this "issue" here and open a new one as soon as I see something. Regarding the very first question in this issue, we can consider it solved. Thank you for your great efforts!!!! I can not repeat often enough.