Skip to content

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

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

Open
wants to merge 9 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.
@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
@journeym
Copy link

journeym commented Feb 11, 2025

this definetly should be merged, at least it works now with the reg and removal of software

Copy link
Contributor

@Karl-WE Karl-WE left a comment

Choose a reason for hiding this comment

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

further comments

Run.bat Outdated

Choose a reason for hiding this comment

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

👍

FREEWING-JP added a commit to FREEWING-JP/tiny11builder that referenced this pull request Mar 2, 2025
Fix with oscdimg.exe search, ExecutionPolicy, compression, etc.. ntdevlabs#319
ntdevlabs#319
FREEWING-JP added a commit to FREEWING-JP/tiny11builder that referenced this pull request Mar 2, 2025
Fix with oscdimg.exe search, ExecutionPolicy, compression, etc.. ntdevlabs#319
ntdevlabs#319
FREEWING-JP added a commit to FREEWING-JP/tiny11builder that referenced this pull request Mar 2, 2025
Fix with oscdimg.exe search, ExecutionPolicy, compression, etc.. ntdevlabs#319
ntdevlabs#319
FREEWING-JP added a commit to FREEWING-JP/tiny11builder that referenced this pull request Mar 2, 2025
Fix with oscdimg.exe search, ExecutionPolicy, compression, etc.. ntdevlabs#319
ntdevlabs#319
@Loufe
Copy link

Loufe commented Mar 23, 2025

I would vote for accepting this PR, a lot of great small cleanups.

- fix (noted in ntdevlabs#339) by adding ':' colon for validation pattern, which used to be set to empty value(resulting in using script root path)
- use `Export-WindowsImage` with undocumented Compression Type for more consistence
- use direct string check for little performance improvement
Remove-Item -Path "$ScratchDisk\tiny11\sources\install.wim" -Force | Out-Null
Rename-Item -Path "$ScratchDisk\tiny11\sources\install2.wim" -NewName "install.wim" | Out-Null
# Run `Export-WindowsImage` with undocumented CompressionType "LZMS" (which is the same compression used for Recovery from dism.exe)
Export-WindowsImage -SourceImagePath "$ScratchDisk\tiny11\sources\install.wim" -SourceIndex "$index" -DestinationImagePath "$ScratchDisk\tiny11\sources\install2.wim" -CompressionType "LZMS"
Copy link
Author

Choose a reason for hiding this comment

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

Although it is said that Compressiontype Recovery is not supported with PShell, actually Export-WindowsImage used to support the same compression algorithm used for Recovery from Windows 10(it internally uses WIMExportFile, which used to support LZMS compression) and it even works with .wim extension.

Copy link
Contributor

@Karl-WE Karl-WE left a comment

Choose a reason for hiding this comment

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

It has been noted in comments that Export Image doesn't support compress which is really odd.

Thanks for your improvements. Unfortunately there are many open PRs that would conflict with your PR.
I hope that the owner can find some time to find a clean way to merge all pending PRs, each of them have unique improvements.

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.

5 participants