nextcloud / nextcloud/client-building
Port Batch scripts to PowerShell
@nilsding is already working on this.
Since Apr 9, 2025.
- Dominant language
- Batchfile
- Stars
- 40
- Forks
- 41
- Avg merge
- 8h 2m
- Merged PRs (30d)
- 2
Description
While working on making the Windows Installer multilingual I noticed that trying to achieve a bit more complex stuff within Batch scripts is very fragile and time-consuming to test -- Batch is full of surprises, even more so when you come from a Linux background and being used to sh's weirdnesses.
I propose to port the build scripts to PowerShell, since this is part of Windows already and doesn't require any extra dependencies (e.g. a working Ruby/Python/Perl/... installation that lives on the %PATH%).
Its scripting language is familiar enough to anyone with a programming background: it has e.g. built-in data types for arrays, hashes/dictionaries; proper functions with named parameters; foreach loops to loop over objects; ...
It would allow us to get rid of workarounds like datetime.inc.bat -- setting the BUILD_DATE variable would then be as easy as $BUILD_DATE = Get-Date -Format "yyyyMMdd".
And, if we ever have the need to deal with JSON data, we could parse these with ConvertFrom-Json.
Furthermore, it would enable us to easily parallelise some steps using e.g. Start-ThreadJob (useful for e.g. building multiple language-specific MSIs at the same time (as long as WiX allows for that), while potentially decreasing the overall build time again)
I would also use this opportunity to remove the old build scripts for the NSIS installer as these haven't been built for releases since at least 2021: https://download.nextcloud.com/desktop/releases/Windows/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.