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

Created Windows Installer + Nightly Builds #357

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nirmie
Copy link

@nirmie nirmie commented May 26, 2024

Created two scripts, a powershell script and nsis script, that work to compile the StableSwarmUI visual studio project into an exe and package it into an installer using NSIS. Also created a GitHub workflow to create a new nightly release every night, but the release portions of the workflow can be adjusted if you only wish to have a new build every week or so. (Can be deleted if unnecessary)

The installer comes with an uninstaller, registers it with Control Panel, and shares the same icon and Licensing as the original project.

Please let me know if I need to make any changes before it can be merged.

@powderluv
Copy link

I would drop the binary files in the commit.

Removed both the built application and the installer exe. To reproduce either one can run the powershell script.
@nirmie
Copy link
Author

nirmie commented May 27, 2024

I've updated it so it does not have the application or the installer. Running the Powershell script should generate both.


# Default env configuration, gets overwritten by the C# code's settings handler
$env:ASPNETCORE_ENVIRONMENT = "Production"
$env:ASPNETCORE_URLS = "http://*:7801"
Copy link
Contributor

Choose a reason for hiding this comment

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

the majority of this script looks like... you converted the launch-windows.bat file to powershell? (there's already a powershell launch script available...) and doesn't actually make sense to be included with the installer

SetOutPath "$INSTDIR"
# Add files to be installed
File /r /x *.bat /x *.sh /x *.ps1 /x StableSwarmUI-Installer.exe /x DOCKERFILE /x .dockerignore \
/x docker-compose.yml /x colab /x .github /x .git /x bin ${__FILEDIR__}\*.*
Copy link
Contributor

Choose a reason for hiding this comment

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

You're just... installing the Swarm files to a path? So still a raw source file install, but minus the scripts and files essential to actually run it

Copy link
Author

Choose a reason for hiding this comment

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

I figured since the source files are packaged into an exe now they would not need the other scripts. In the powershell script the source code is built so they could show up as an application since I thought the batch file would be less familiar for a normal consumer. I can leave the mac and linux bash files but I thought it wouldn't be too helpful on a windows installer.

Copy link
Contributor

Choose a reason for hiding this comment

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

But it's still including eg *.cs code files is what's confusing me - it's still dumping source code, just minus the bits to run it.

It also appears to not be excluding eg Data, Models, dlbackend, etc. that would make a -giant- installer file if ever accidentally ran from an in-use directory

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I seemed to overlooked that. I'll remove the .cs files and have it exclude the mentioned directories but still create empty folders for the models and similar folders. I thought the script to make the installer would only be ran by the remote repository for the newest build but I suppose it doesn't hurt to make it foolproof if ran on a computer with a model loaded.

Copy link
Contributor

Choose a reason for hiding this comment

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

Swarm's code autogenerates all needed folders already you don't need to worry about creating them.

@mcmonkey4eva
Copy link
Contributor

How would updating work with this setup? ie how does an end user who installed with this update to a newer version of Swarm?

shell: pwsh
run: ./nightly_build.ps1

- name: Create Release
Copy link
Contributor

Choose a reason for hiding this comment

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

Creating a new release nightly would quickly spam the releases page - it would probably make more sense for it to just edit the file into the latest release rather than making a whole new release every time

Copy link
Author

Choose a reason for hiding this comment

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

Yeah I was thinking about that, I will change it so it edits the same release.

@mcmonkey4eva
Copy link
Contributor

oh btw, I recommend testing carefully - run an install and go through things like generating some images, using custom comfy workflows, etc.

A particular point I'm worried about is, if you open up the C# in Visual Studio and track down usages of Extension.FilePath -- that by default is set by looking for the Extension source code folder and working with it.
All of swarm is built under the assumption you're doing a source install (how you do with eg python programs) and not like an independent .exe program install, and so likely many things that end up needing alternate handling for this case.

@nirmie
Copy link
Author

nirmie commented May 27, 2024

Yeah, I'll make sure to comb through the C# code and run models before pushing code. I'll let you know once I incorporate all of these changes so it can be reviewed.

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.

3 participants