svengeance / Husky

Modernizing the way developers think about installers
3 stars 0 forks source link

[Example Request] Full Installer Workflow #7

Closed svengeance closed 3 years ago

svengeance commented 3 years ago

Key Points

Summary

This is the final integration of all parts for the proof of concept that should demo all of Husky's capabilities.

svengeance commented 3 years ago

Example YML File

name: Husky App # Initial app metadata is set at the top
version: 0.1
publisher: Svengeance
dependencies: # Dependencies that Husky can't track are explicitly stated
    - DotNetCore>=5.0
variables: # Global constant values the user can set up top
    installDir: $folders.ProgramFiles + /HuskyApp

jobs: # A single job can exist without an explicitly declared stage
    show-splash:
        steps:
            - name: Display Unix Splash Screen
              platforms: # Aligns with the existing dotnet plaform support
                - FreeBSD
                - Linux
                - OSX
              task: Scripting.ExecuteInlineScript
              script: | # Unix-specific script
                cls &&
                echo Welcome to Husky-App! &&
                read -n 1 -r -s -p $'Press any key to continue installation...\n'              

            - name: Display Windows Splash Screen
              platforms: Windows
              task: Scripting.ExecuteInlineScript
              script: | # Windows (cmd) specific script
                clear &&
                echo Welcome to Husky-App! &&
                pause

    extract-husky-app:
        steps:
            - name: Extract App Files
              task: Resources.ExtractBundledResource
              resources: dist/program/**/* # standard file globbing pattern
              targetDirectory: $variables.installDir
              clean: true # Clean the destination directory 

    create-shortcut:
        steps:
            - name: Create Launch Shortcut
              task: Scripting.CreateScriptFile # Create a platform-independent script file (.sh on linux, .bat on windows)
              directory: $variables.installDir
              fileName: launch
              script: dotnet Huskyapp.dll
              output: # assign output variables FROM the step into inter-job variables
                app-launch-file: createdFileName

            - name: Create Desktop Shortcut
              task: Utilities.CreateShortcut # Create a platform-independent shortcut 
              target: $jobs.create-shortcut.variables.app-launch-file # Variables are scoped at the job level
svengeance commented 3 years ago

Updated file as of current implementation. Notable changes: input task variables are now in a with subsection. Output variables are eliminated and will be described in documentation rather than requiring users to name them.

---
  name: Husky App # Initial app metadata is set at the top
  version: 0.1
  publisher: Svengeance
  dependencies: # Dependencies that Husky can track are explicitly stated
      - DotNetCore>=5.0
  variables: # Global constant values the user can set up top
      installDir: '{folders.ProgramFiles}/HuskyApp'

  jobs: # A single job can exist without an explicitly declared stage
      show-splash:
          steps:
              show-unix-splash:
                platforms:
                  - Linux
                  - OSX
                  - FreeBSD
                task: Scripting.ExecuteInlineScript
                with:
                  script: | # Unix-specific script
                    clear &&
                    echo Welcome to Husky-App! &&
                    sleep 10 &&
                    exit 0

              show-windows-splash:
                platforms:
                  - Windows
                task: Scripting.ExecuteInlineScript
                with:
                  script: | # Windows (cmd) specific script
                    cls &&
                    echo Welcome to Husky-App! &&
                    timeout 10 /NOBREAK &&
                    exit

      extract-husky-app:
          steps:
              extract-files:
                task: Resources.ExtractBundledResource
                with:
                  resources: dist/program/**/* # standard file globbing pattern
                  targetDirectory: '{variables.installDir}'
                  clean: true # Clean the destination directory 

      create-launch-file:
          steps:
              create-launch-script:
                task: Scripting.CreateScriptFile # Create a platform-independent script file (.sh on linux, .bat on windows)
                with:
                  directory: '{variables.installDir}'
                  fileName: launch
                  script: dotnet Huskyapp.dll

              create-shortcut:
                task: Utilities.CreateShortcut # Create a platform-independent shortcut 
                with:
                  shortcutLocation: '{folders.Desktop}'
                  shortcutName: 'HuskyApp'
                  target: '{variables.create-launch-file.create-launch-script.createdFileName}' # Retrieve variable from prior step
svengeance commented 3 years ago

f8bfa85c finishes windows registry post-registration 15c302a7 finishes adding pre-requisites for developers to specify that client machines must satisfy

svengeance commented 3 years ago

29 finishes the uninstaller piece, and our initial PoC can be marked complete.

svengeance commented 3 years ago

pog