Skip to content

Instantly share code, notes, and snippets.

@DrewNaylor
Last active August 16, 2021 14:43
Show Gist options
  • Save DrewNaylor/22e3f1cded702fff494a46dabe643fde to your computer and use it in GitHub Desktop.
Save DrewNaylor/22e3f1cded702fff494a46dabe643fde to your computer and use it in GitHub Desktop.
This is called UXL Autobuild Script. The purpose of UXL Autobuild Script (or UAS) is to expediate the downloading, extracting, and building of UXL Launcher for developers or those who want to test the latest changes as soon as possible. Scroll past the changelog.md file to get to the script. Main repository: https://github.com/DrewNaylor/UXL-Lau…

As it turns out, the script started working again at some point, possibly with Windows 10 1903. PowerShell was likely updated to use better encryption compatible with GitHub's servers. The message below is outdated.

Please be aware that this script no longer works as of February 23, 2018, due to changes with GitHub's servers. See here. An alternate method to trying the latest changes from the master branch is by downloading the latest build's artifacts from AppVeyor. When the download has completed, extract the archive, then open the Debug folder. In this folder, double-click on UXL-Launcher.exe.

Version 2021.08-1 changelog:

  • Changed: It's now licensed under the Apache License 2.0 so that people can publicly use and modify it. Didn't know not having a license prevented public use and modification by other people.

Version 2018.01-1 changelog:

  • Changed: Updated copyright years.
  • Fixed: If the user types "README", the script now directs them to the System Requirements section of the UXL Launcher README.md file instead of a part of the page that I removed.

Version 2017.02-4 changelog:

  • Fixed: If the user has a space in their username on their PC, the package extraction process completes successfully. This problem should now be fixed, unlike in Version 2017.02-1 and Version 2017.02-3.
  • New: The window title now changes back to "Command Prompt" when the script exits.
  • New: The command prompt window is now cleared upon running the script.

Version 2017.02-3 changelog:

  • Fixed: Just like in Version 2017.02-1, there are now quote marks around all the directory names that use the current user's name to ensure that there are no problems with users who have a space between parts of their name such as with first and last names.

Version 2017.02-2 changelog:

  • Fixed: Regression on 32-bit computers due to forgetting to remove some code from the build process. I was making sure the titlebar would update when running that code so earlier I commented out the 64-bit code and meant to temporarily change the 32-bit code to work with 64-bit computers. I forgot to remove that code when uncommenting the rest of the code.

Version 2017.02-1 changelog:

  • Fixed: Corrected a typo.
  • Fixed: Potential issue if the user has a username that has a space between the names, such as for a first name and a last name.
  • Improved: Capitalized the word "Version" to align with my app launcher capitalization, except for a code comment since that particular instance refers to versioning in general.
  • New: The titlebar text now changes to reflect the current status of the script, such as when downloading and extracting the package. These status messages still appear in the body of the Command Prompt just like older versions, however.

Version 2017.01-1 changelog:

  • Improved: The paragraphs should look better now because there's only one echo command for each paragraph instead one command per line.
  • Improved: Just in case the script is run on a network drive, I'm using echo( instead of echo. to hopefully avoid any performance problems.
  • Improved: Now using active verb tense instead of passive when telling the user what's happening such as when downloading the archive. There's also ellipseses on the end of the active verb sentences now.

Version 2016.11-4 changelog:

  • Fixed: The script now properly points to MSBuild even if Visual Studio 2015 isn't installed on the user's computer.
  • Fixed: If the user is on a 32-bit PC and they don't have Program Files (x86), automatically choose Program Files for the msbuild directory.

Version 2016.11-3 doesn't work properly, so don't use it.

@echo off
cls
REM This script automatically downloads, extracts, builds, and runs the latest changes in the UXL Launcher master branch.
REM Licensed under the Apache License, Version 2.0: https://www.apache.org/licenses/LICENSE-2.0.html
REM Current script version:
set VERSIONNUMBER=2021.08-1
REM Create variable for the titlebar text when not doing anything:
set REGULAR_TITLE_BAR=UXL Autobuild Script Version %VERSIONNUMBER%
REM Create variable for the titlebar text when downloading the package:
set DOWNLOADING_TITLE_BAR=UXL Autobuild Script Version %VERSIONNUMBER%: Downloading package from GitHub...
REM Create variable for the titlebar text when extracting the package:
set EXTRACTING_TITLE_BAR=UXL Autobuild Script Version %VERSIONNUMBER%: Extracting package previously downloaded from GitHub...
REM Create variable for the titlebar text when building the VB project:
set BUILDING_TITLE_BAR=UXL Autobuild Script Version %VERSIONNUMBER%: Building the VBProj file...
REM Create variable for the titlebar text when running the built EXE file:
set RUNNING_TITLE_BAR=UXL Autobuild Script Version %VERSIONNUMBER%: Running the EXE file...
REM Set the titlebar text to the regular text:
title %REGULAR_TITLE_BAR%
:beginning-of-script
echo UXL Autobuild Script (or UAS) is provided to others free of charge and without warranty by Drew Naylor.
echo UAS Version %VERSIONNUMBER% Copyright 2016-2018, 2021 Drew Naylor.
echo Licensed under the Apache License, Version 2.0: https://www.apache.org/licenses/LICENSE-2.0.html
echo Drew Naylor has no relation to Microsoft or GitHub.
echo UAS is not to be confused with other projects and software with a similar name.
echo If anything happens to your computer, Drew Naylor is not responsible. Use at your own risk.
echo Please visit https://github.com/DrewNaylor/UXL-Launcher/ for more information on UXL Launcher which is open source.
echo(
echo The purpose of UAS is to expediate the downloading, extracting, and building of UXL Launcher for developers or those who want to test the latest changes as soon as possible. Not recommended for end users who want stable software. UAS will use PowerShell to download a Zip file from github.com, extract it into a temp file in your user profile folder with PowerShell, and build the Visual Basic project file with MSBuild.
echo(
echo Windows PowerShell, Microsoft Build Tools 2015 and Microsoft .Net Framework 4.6.1 are required to build and run this application. Links are available in the System Requirements in the README file here: https://github.com/DrewNaylor/UXL-Launcher/blob/master/README.md#system-requirements
echo(
echo --------------------------------------
echo(
REM Start asking the user if they want to continue.
echo Would you like to continue running this script? Type "Yes" to continue, "no" to abort, or "README" to see the links for required software mentioned above. Currently UAS only supports the Master branch of UXL Launcher.
set /p BUILDQUESTION=
If %BUILDQUESTION%==no exit cmd
If %BUILDQUESTION%==Yes goto start-building
If %BUILDQUESTION%==README start "" https://github.com/DrewNaylor/UXL-Launcher/blob/master/README.md#system-requirements
REM If the user types either README or something else that doesn't have a goto or exit command in the "If" line, clear
REM the screen and go back to the beginning of the script.
cls
goto beginning-of-script
:start-building
REM The code below here will be where the build starts.
cls
REM Set titlebar text to the downloading text:
title %DOWNLOADING_TITLE_BAR%
echo Downloading package from GitHub...
powershell Invoke-WebRequest "https://github.com/DrewNaylor/UXL-Launcher/archive/master.zip" -OutFile "$env:TEMP\uxl-launcher-master.zip" -UseBasicParsing
echo(
REM Set titlebar text to the extracting text:
title %EXTRACTING_TITLE_BAR%
echo Extracting package previously downloaded from GitHub...
powershell Expand-Archive -Path "$env:TEMP\uxl-launcher-master.zip" -DestinationPath " 'C:\Users\%USERNAME%\0AppLauncherBuilds\uxl-master' " -Force
REM Decide which Program Files folder to run msbuild from based on which folders exist. Courtesy this
REM Stack Overflow answer: <http://superuser.com/a/142416>
if defined ProgramFiles(x86) (
REM If the PC has Program Files (x86), run msbuild from this folder.
echo(
REM Set titlebar text to the building text:
title %BUILDING_TITLE_BAR%
echo Building the VBProj file...
echo(
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "C:\Users\%USERNAME%\0AppLauncherBuilds\uxl-master\UXL-Launcher-master\UXL-Launcher\UXL-Launcher.vbproj"
echo(
) else (
REM If the PC only has Program Files, run msbuild from another folder.
echo(
REM Set titlebar text to the building text:
title %BUILDING_TITLE_BAR%
echo Building the VBProj file...
echo(
"C:\Program Files\MSBuild\14.0\Bin\MSBuild.exe" "C:\Users\%USERNAME%\0AppLauncherBuilds\uxl-master\UXL-Launcher-master\UXL-Launcher\UXL-Launcher.vbproj"
)
echo(
REM Set titlebar text to the running text:
title %RUNNING_TITLE_BAR%
echo Running the EXE file...
"C:\Users\%USERNAME%\0AppLauncherBuilds\uxl-master\UXL-Launcher-master\UXL-Launcher\bin\Debug\UXL-Launcher.exe"
REM Set titlebar back to default.
title Command Prompt
@DrewNaylor
Copy link
Author

As far as I know, this only works on Windows 10. The PowerShell commands don't seem to work on Windows 7.

@DrewNaylor
Copy link
Author

@DrewNaylor
Copy link
Author

@DrewNaylor
Copy link
Author

Actually, PowerShell 5.0 is required for all the commands to work and is available for Windows 7 and up but not Windows 8.0. Download link:

https://www.microsoft.com/en-us/download/details.aspx?id=50395

@DrewNaylor
Copy link
Author

DrewNaylor commented Nov 29, 2016

Version 2016.11-3 changelog:
Fixed: If the user is on a 32-bit PC and they don't have Program Files (x86), automatically choose Program Files for the msbuild directory.

@DrewNaylor
Copy link
Author

Version 2016.11-4 changelog:
Fixed: The script now properly points to MSBuild even if Visual Studio 2015 isn't installed on the user's computer.
Fixed: If the user is on a 32-bit PC and they don't have Program Files (x86), automatically choose Program Files for the msbuild directory.

Version 2016.11-3 doesn't work properly, so don't use it.

@DrewNaylor
Copy link
Author

DrewNaylor commented Jan 7, 2017

Version 2017.01-1 changelog:

  • Improved: The paragraphs should look better now because there's only one echo command for each paragraph instead one command per line.
  • Improved: Just in case the script is run on a network drive, I'm using echo( instead of echo. to hopefully avoid any performance problems.
  • Improved: Now using active verb tense instead of passive when telling the user what's happening such as when downloading the archive. There's also ellipseses on the end of the active verb sentences now.

Version 2016.11-4 changelog:

  • Fixed: The script now properly points to MSBuild even if Visual Studio 2015 isn't installed on the user's computer.
  • Fixed: If the user is on a 32-bit PC and they don't have Program Files (x86), automatically choose Program Files for the msbuild directory.

Version 2016.11-3 doesn't work properly, so don't use it.

@DrewNaylor
Copy link
Author

Improvement idea: Change the titlebar text when the script is downloading, extracting, and building the EXE file. When the script finishes but before launching the EXE file, change the titlebar text back to what it started out as.

@DrewNaylor
Copy link
Author

Improvement idea: Capitalize the letter "v" in "version" for the titlebar.

@DrewNaylor
Copy link
Author

Version 2017.02-1 changelog:

  • Fixed: Corrected a typo.
  • Fixed: Potential issue if the user has a username that has a space between the names, such as for a first name and a last name.
  • Improved: Capitalized the word "Version" to align with my app launcher capitalization, except for a code comment since that particular instance refers to versioning in general.
  • New: The titlebar text now changes to reflect the current status of the script, such as when downloading and extracting the package. These status messages still appear in the body of the Command Prompt just like older versions, however.

Version 2017.01-1 changelog:

  • Improved: The paragraphs should look better now because there's only one echo command for each paragraph instead one command per line.
  • Improved: Just in case the script is run on a network drive, I'm using echo( instead of echo. to hopefully avoid any performance problems.
  • Improved: Now using active verb tense instead of passive when telling the user what's happening such as when downloading the archive. There's also ellipseses on the end of the active verb sentences now.

Version 2016.11-4 changelog:

  • Fixed: The script now properly points to MSBuild even if Visual Studio 2015 isn't installed on the user's computer.
  • Fixed: If the user is on a 32-bit PC and they don't have Program Files (x86), automatically choose Program Files for the msbuild directory.

Version 2016.11-3 doesn't work properly, so don't use it.

@DrewNaylor
Copy link
Author

Version 2017.02-2 changelog:

  • Fixed: Regression on 32-bit computers due to forgetting to remove some code from the build process. I was making sure the titlebar would update when running that code so earlier I commented out the 64-bit code and meant to temporarily change the 32-bit code to work with 64-bit computers. I forgot to remove that code when uncommenting the rest of the code.

Version 2017.02-1 changelog:

  • Fixed: Corrected a typo.
  • Fixed: Potential issue if the user has a username that has a space between the names, such as for a first name and a last name.
  • Improved: Capitalized the word "Version" to align with my app launcher capitalization, except for a code comment since that particular instance refers to versioning in general.
  • New: The titlebar text now changes to reflect the current status of the script, such as when downloading and extracting the package. These status messages still appear in the body of the Command Prompt just like older versions, however.

Version 2017.01-1 changelog:

  • Improved: The paragraphs should look better now because there's only one echo command for each paragraph instead one command per line.
  • Improved: Just in case the script is run on a network drive, I'm using echo( instead of echo. to hopefully avoid any performance problems.
  • Improved: Now using active verb tense instead of passive when telling the user what's happening such as when downloading the archive. There's also ellipseses on the end of the active verb sentences now.

Version 2016.11-4 changelog:

  • Fixed: The script now properly points to MSBuild even if Visual Studio 2015 isn't installed on the user's computer.
  • Fixed: If the user is on a 32-bit PC and they don't have Program Files (x86), automatically choose Program Files for the msbuild directory.

Version 2016.11-3 doesn't work properly, so don't use it.

@DrewNaylor
Copy link
Author

DrewNaylor commented Feb 19, 2017

Version 2017.02-3 changelog:

  • Fixed: Just like in Version 2017.02-1, there are now quote marks around all the directory names that use the current user's name to ensure that there are no problems with users who have a space between parts of their name such as with first and last names.

I'm not going to post changelogs in this gist's comment section until further notice. I will start using a markdown file instead.

Version 2017.02-2 changelog:

  • Fixed: Regression on 32-bit computers due to forgetting to remove some code from the build process. I was making sure the titlebar would update when running that code so earlier I commented out the 64-bit code and meant to temporarily change the 32-bit code to work with 64-bit computers. I forgot to remove that code when uncommenting the rest of the code.

Version 2017.02-1 changelog:

  • Fixed: Corrected a typo.
  • Fixed: Potential issue if the user has a username that has a space between the names, such as for a first name and a last name.
  • Improved: Capitalized the word "Version" to align with my app launcher capitalization, except for a code comment since that particular instance refers to versioning in general.
  • New: The titlebar text now changes to reflect the current status of the script, such as when downloading and extracting the package. These status messages still appear in the body of the Command Prompt just like older versions, however.

Version 2017.01-1 changelog:

  • Improved: The paragraphs should look better now because there's only one echo command for each paragraph instead one command per line.
  • Improved: Just in case the script is run on a network drive, I'm using echo( instead of echo. to hopefully avoid any performance problems.
  • Improved: Now using active verb tense instead of passive when telling the user what's happening such as when downloading the archive. There's also ellipseses on the end of the active verb sentences now.

Version 2016.11-4 changelog:

  • Fixed: The script now properly points to MSBuild even if Visual Studio 2015 isn't installed on the user's computer.
  • Fixed: If the user is on a 32-bit PC and they don't have Program Files (x86), automatically choose Program Files for the msbuild directory.

Version 2016.11-3 doesn't work properly, so don't use it.

@DrewNaylor
Copy link
Author

New idea: Allow this script to update itself with code that downloads the current version of this script. It would be good to check if the version is newer than the current version, maybe by searching for a string of text and seeing if it's bigger, I'm not really sure.

Another new idea: Instead of using a GitHub Gist for this script, move it to its own GitHub repository. The way I might be able to make it work is to update this Gist to tell the user that the file moved and to run the update in the script to get the latest version which would be stored in its own repository. The updater would then download the current release from that repository instead of this Gist. Also, that would allow better organization of information about this script.

Third new idea: Maybe I should actually put this script in the UXL Launcher repository. It would make much more sense being there instead of its own one.

Fourth new idea: Maybe I could modify this script so that it could download new stable release updates for UXL Launcher from the GUI. This could be done by reading a file that has the current stable release (like v3.0-stable or something) then downloading the EXE/Zip package for it. I really need to make an installer. Maybe NSIS will work fine with the Zip2EXE, if it doesn't refuse to work like it did before. If NSIS doesn't work, I could just use InnoSetup.

@DrewNaylor
Copy link
Author

This currently doesn't work due to this change with GitHub's servers: https://blog.github.com/2018-02-23-weak-cryptographic-standards-removed/ I want to find a way to make it work again properly.

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