thilojaeggi / WinGetty

An open source REST Backend for creating a private WinGet Repo without having to rely on cloud dependencies.
https://wingetty.dev
GNU Affero General Public License v3.0
168 stars 15 forks source link

Run Script (.ps1 or .cmd) to run a SW installation #47

Closed Brickleton closed 3 months ago

Brickleton commented 3 months ago

Hello,

I am looking for an option to preferably run PowerShell or batch scripts for the installation. The background to this is that I would like to test whether I can implement the configurations relevant to my work during a software installation. For this we use scripts that trigger the installation of the software, but also implement other things, such as copying a .config file or removing desktop shortcuts. Is something like this currently possible? If not, would it be possible to include this in a future release?

Many thanks for your efforts

Kevin

thilojaeggi commented 3 months ago

I think this should work already if you use the "nested" installer type and specify ./setup.ps1, I'm unsure if winget allows you to actually modify user data with this script though like editing the Desktop. Under nested installer you also need to select the installer type of the nested installer, you could experiment around with the options.

Brickleton commented 3 months ago

Thank your for the fast reply. Sadly it is not possible. I've already trided this, but it only opens the .ps1 file in the editor. Seems like a security feature from Microsoft, because this is the normale behavior when I double click the file. Using the powershell.exe from system32 and starting it with the .ps1 script wont work.

Any other idea or possibility to add something what could handle this?

Many thanks for your work on wingetty and your support.

thilojaeggi commented 3 months ago

I think as long as the winget spec doesn't support this I won't be able to implement this. Since you mentioned editing Desktop items it sounds similar to "winget configure" https://learn.microsoft.com/en-us/windows/package-manager/configuration/ sadly these configuration files can't be hosted on a WinGet repo yet.

Brickleton commented 3 months ago

And would it be possible to run a .cmd file? When I add the .cmd file as I added the .ps1 the installation failures every time.

thilojaeggi commented 3 months ago

I assume also not due to winget not officially supporting this.

Brickleton commented 3 months ago

Alright then thank you for your support, i will keep an eye on wingetty, its a very cool project. I will cloese this issue with this comment