Skip to content

Port Batch scripts to PowerShell #142

Description

@nilsding

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/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions