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

[Feature Request]: Make source parameters configurable to support private repositories #668

Open
eclipse313 opened this issue Aug 28, 2024 · 8 comments
Labels
enhancement New feature or request stale

Comments

@eclipse313
Copy link

eclipse313 commented Aug 28, 2024

The request

I would like to make the source parameter configurable. Currently -s winget is always used as an argument so that private repositories are ignored.

But since I only want to use some packages from my private repository and some from the normal winget repository, changes are necessary in several places.

1st problem: How can I add my source?

I think we can simply use the _WAU-mods.ps1 file. There you can first check if the desired source is already registered and then register it. The necessary functions for this could be provided in _Mods-Functions.ps1.

Example for _WAU-mods.ps1:

if (!Exists-Source "nameofmysource") {
  Add-Source -n "nameofmysource" -a "https://example.org" -t "Microsoft.Rest"
}

2nd problem: Adjustment of the -s parameter

The -s parameter cannot simply be removed, as this could have undesired side-effects for existing installations, as currently only winget is searched for and not msstore.

I would suggest adding a registry entry WAU_DefaultSource. This can either be any value, then this value is passed to -s. If the key does not exist -s winget is passed to winget to maintain backward compatibility. If the value is *, the parameter -s is not passed at all in order to search all repositories (including a private one).

Summarized:
WAU_DefaultSource does not exist → winget ... -s winget
WAU_DefaultSource = abc → winget ... -s abc
WAU_DefaultSource = winget → winget ... -s winget
WAU_DefaultSource = * → winget ... (without -s)

3rd problem: Winget-Install.ps1

In order to distribute new WinGet apps in private repositories via Intune, the Winget-Install.ps1 must also be adapted.

An optional parameter $Source would be sufficient here (I think):
[Parameter(Mandatory = $False)] [Switch] $Source.

I'm just not quite sure how to make sure that the source is already set up in winget.

Is this something that basically has a place in WAU or are there problems with it that I can't see right now.

I can just do a fork and try to implement some of the stuff, but my PowerShell skills are a bit rusty to be honest.

Therefore, before we or I do the work, I would first like to clarify whether this would be a welcome extension.

Thanks,
Thomas

@eclipse313 eclipse313 added the enhancement New feature or request label Aug 28, 2024
@eclipse313
Copy link
Author

Note: This topic was originally started in #559

@eclipse313
Copy link
Author

I have already tried to implement this for winget-install.ps1. You can check my attempts here: eclipse313/Winget-Install@0e35422

@eclipse313
Copy link
Author

Hi @Romanitho, Do you perhaps have time to take a look at it and give me your opinion? I can also try to continue my fork, I would just like to know if the concept fits with your ideas. Thanks :)

@Romanitho
Copy link
Owner

Hi, it looks good to me. Definitely something we can try to integrate to WAU.

Copy link
Contributor

github-actions bot commented Oct 4, 2024

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Oct 4, 2024
@eclipse313
Copy link
Author

Hi @Romanitho, this is still a very important feature for me. Especially with the MSI package, I see real potential there.

Is there anything I can do to help you or is my suggestion in the commit (eclipse313/Winget-Install@0e35422) enough?

Please let me know how I can support...

@Romanitho
Copy link
Owner

Apologies for the delay, but my top priority was to create that MSI to simplify everything. Now, after much work and testing, we are quite confident with this v2. We can now work on this type of feature with pleasure.

@github-actions github-actions bot removed the stale label Oct 13, 2024
Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants