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

Fix with oscdimg.exe search, ExecutionPolicy, compression, etc.. #319

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Snshadow
Copy link

@Snshadow Snshadow commented Jan 15, 2025

- Edit README.md part for `Set-ExecutionPolicy` to use `-Scope Process` to prevent changing the entire computer's policy.
- Fix tiny11maker.ps1 and tiny11Coremaker.ps1 to find oscdimg.exe from registry instead of using fixed path.
- Add Run.bat helper batch file(referenced from Win11Debloat) to help running tiny11maker with double clicking.
@Snshadow
Copy link
Author

Snshadow commented Jan 15, 2025

Although it is stated that this project is open-source, it would be nice to add the license(MIT, BSD, Apache 2.0) file as the github document says However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work.

If you've chosen not to license this project for some reason, I respect that decision 😊.

- Add AllSigned, Undefined for consideration which also prevent script from running
# Check if PowerShell execution is restricted
if ((Get-ExecutionPolicy) -eq 'Restricted') {
Write-Host "Your current PowerShell Execution Policy is set to Restricted, which prevents scripts from running. Do you want to change it to RemoteSigned? (yes/no)"
# Check if PowerShell execution is Restricted or AllSigned or Undefined
Copy link
Author

@Snshadow Snshadow Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious if this part is actually called, is this for some possible cases where the user tries to run it from powershell they have been using for different activity which could have set ExecutionPolicy to the value that does not allow script to run? I think in normal cases, the user will run it with from the powershell which have the ExecutionPolicy that allow to run custom scripts, and it is inherited, which make it will never be the ones that need to be changed for elevation.

@Snshadow Snshadow force-pushed the several-fixes branch 3 times, most recently from b6c11dc to 399cddd Compare January 15, 2025 04:20
- fix the cause of crash if ADK is not installed
@Snshadow Snshadow marked this pull request as draft January 15, 2025 07:20
- Get architecture using Get-WindowsImage and its property directly.
- Use Get-AppxProvisionedPackage and Remove-AppxProvisionedPackage instead if dism for more consistence.
- Use Export-WindowsImage with -CompressionType Maximum instead of Fast for smaller type(used to be recovery with dism.exe).
@Snshadow Snshadow marked this pull request as ready for review January 15, 2025 08:29
- align switch block
- Revert to use dism for exporting install.esd to use recovery compression which reduced the size about 1 gigabytes.
- Add outlook provisioned appxpackage for removal.
# Compressiontype Recovery is not supported with PShell https://learn.microsoft.com/en-us/powershell/module/dism/export-windowsimage?view=windowsserver2022-ps#-compressiontype
Export-WindowsImage -SourceImagePath $ScratchDisk\tiny11\sources\install.wim -SourceIndex $index -DestinationImagePath $ScratchDisk\tiny11\sources\install2.wim -CompressionType Maximum
# Compressiontype Recovery is not supported with PShell https://learn.microsoft.com/en-us/powershell/module/dism/export-windowsimage?-ps#-compressiontype
& dism /English /Export-Image "/SourceImageFile:$ScratchDisk\tiny11\sources\install.wim" "/SourceIndex:$index" "/DestinationImageFile:$ScratchDisk\tiny11\sources\install.esd" /Compress:recovery
Copy link
Author

@Snshadow Snshadow Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From 7ec6a7c, looks like using recovery compression to export wim image worked at some time? Currently when I tested with Window 11 23H2 and it creates garbage file which has nothing at all(this is somehow expected as .esd extension is required for recovery compression(I somehow have an iso file created with tiny11maker.ps1 which has install.wim file compressed with recovery compression(LZMS)(?), so it looks like it used to work previously at some time, which is not guaranteed). Actually tiny11CoreMaker.ps1 currently exports as .esd image, and it boots without issue, so I think keeping using dism is necessary for this part.

@Snshadow Snshadow changed the title Some fixes to handle some issues(oscdimg.exe, ExecutionPolicy) Some fixes to handle some issues Jan 16, 2025
@Snshadow Snshadow changed the title Some fixes to handle some issues Fix with oscdimg.exe search, ExecutionPolicy, compression, etc.. Jan 16, 2025
- revert packagePrefixed change as the package is already in github.com/ntdevlabs/pull/253
- registry value from WOW6432Node is regarded first for setup
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 this pull request may close these issues.

1 participant