diff --git a/Add_Structure.ps1 b/Add_Structure.ps1 index fa0bd08..cf7ce6d 100644 --- a/Add_Structure.ps1 +++ b/Add_Structure.ps1 @@ -85,7 +85,7 @@ $Progress_Activity = "Enabling Run in Sandbox context menus" Write-Progress -Activity $Progress_Activity -PercentComplete 1 $Check_Sources_Files_Count = (Get-ChildItem "$Current_Folder\Sources\Run_in_Sandbox" -Recurse).count -If ($Check_Sources_Files_Count -ne 58) { +If ($Check_Sources_Files_Count -ne 39) { Write_Log -Message_Type "ERROR" -Message "Some contents are missing" [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.MessageBox]::Show("It seems you don't have dowloaded all the folder structure !!!") diff --git a/CHANGELOG.md b/CHANGELOG.md index 543a59f..f04f149 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## 2023-03-07 +### Added +- Added ServiceUI +### Changed +- Replaced PSexec with ServiceUI for intunewin sandbox +### Removed +- Removed psexec in favor of ServiceUI + ## 2023-03-06 ### Added - Added option to Sandbox_Config.xml to cleanup leftover .wsb file afterwards (default is true) diff --git a/Sources/Run_in_Sandbox/AppBundle_Install.ps1 b/Sources/Run_in_Sandbox/AppBundle_Install.ps1 index 6930343..01a1d8f 100644 --- a/Sources/Run_in_Sandbox/AppBundle_Install.ps1 +++ b/Sources/Run_in_Sandbox/AppBundle_Install.ps1 @@ -36,47 +36,5 @@ ForEach ($App in $Apps_to_install) { } If ( ($App_File -like "*.ps1*") -or ($App_File -like "*.vbs*") ) { & { Invoke-Expression ($App_Full_Path) } - } - # & { Invoke-Expression ($App_Full_Path) } } -} - - -# set-location "$Intunewin_Extracted_Folder\$FileName" -# $file = "$Sandbox_Folder\Intunewin_Install_Command.txt" -# & { Invoke-Expression (Get-Content -Raw $file) } - - -# $Intunewin_Content_File = "$Sandbox_Folder\Intunewin_Folder.txt" -# $ScriptPath = get-content $Intunewin_Content_File - - -# $FolderPath = Split-Path (Split-Path "$ScriptPath" -Parent) -Leaf -# $DirectoryName = (get-item $ScriptPath).DirectoryName -# $FileName = (get-item $ScriptPath).BaseName - -# $Intunewin_Extracted_Folder = "C:\Windows\Temp\intunewin" -# new-item $Intunewin_Extracted_Folder -Type Directory -Force -# copy-item $ScriptPath $Intunewin_Extracted_Folder -Force -# $New_Intunewin_Path = "$Intunewin_Extracted_Folder\$FileName.intunewin" - -# set-location $Sandbox_Folder -# & .\IntuneWinAppUtilDecoder.exe $New_Intunewin_Path -s -# $IntuneWinDecoded_File_Name = "$Intunewin_Extracted_Folder\$FileName.Intunewin.decoded" - -# new-item "$Intunewin_Extracted_Folder\$FileName" -Type Directory -Force | out-null - -# $IntuneWin_Rename = "$FileName.zip" - -# Rename-Item $IntuneWinDecoded_File_Name $IntuneWin_Rename -force - -# $Extract_Path = "$Intunewin_Extracted_Folder\$FileName" -# Expand-Archive -LiteralPath "$Intunewin_Extracted_Folder\$IntuneWin_Rename" -DestinationPath $Extract_Path -Force - -# Remove-Item "$Intunewin_Extracted_Folder\$IntuneWin_Rename" -force -# sleep 1 - -# set-location "$Intunewin_Extracted_Folder\$FileName" -# $file = "$Sandbox_Folder\Intunewin_Install_Command.txt" -# & { Invoke-Expression (Get-Content -Raw $file) } - +} \ No newline at end of file diff --git a/Sources/Run_in_Sandbox/IntuneWin_Install.ps1 b/Sources/Run_in_Sandbox/IntuneWin_Install.ps1 index b8fdc77..f429993 100644 --- a/Sources/Run_in_Sandbox/IntuneWin_Install.ps1 +++ b/Sources/Run_in_Sandbox/IntuneWin_Install.ps1 @@ -27,14 +27,14 @@ Expand-Archive -LiteralPath "$Intunewin_Extracted_Folder\$IntuneWin_Rename" -Des Remove-Item "$Intunewin_Extracted_Folder\$IntuneWin_Rename" -Force Start-Sleep 1 -$PSexec = "c:\pstools\PSexec.exe" +$ServiceUI = "C:\RunInSandbox\ServiceUI.exe" $WorkDir = "$Intunewin_Extracted_Folder\$FileName" $File = "$Sandbox_Folder\Intunewin_Install_Command.txt" $command = Get-Content -Raw $File -$cmd = "$psexec -w `"$workdir`" -si -accepteula $command" -Set-Location "$Intunewin_Extracted_Folder\$FileName" +$cmd = "$ServiceUI -process:explorer.exe $command" -& { Invoke-Expression $cmd } +Set-Location "$Intunewin_Extracted_Folder\$FileName" +& { Invoke-Expression $cmd } \ No newline at end of file diff --git a/Sources/Run_in_Sandbox/PsExec.exe b/Sources/Run_in_Sandbox/PsExec.exe deleted file mode 100644 index 446a8df..0000000 Binary files a/Sources/Run_in_Sandbox/PsExec.exe and /dev/null differ diff --git a/Sources/Run_in_Sandbox/ServiceUI.exe b/Sources/Run_in_Sandbox/ServiceUI.exe new file mode 100644 index 0000000..4ecfbe5 Binary files /dev/null and b/Sources/Run_in_Sandbox/ServiceUI.exe differ