Using Build Scripts to Deploy to an Ubuntu repository and a windows installer (NSIS)

I’ve included more info that is needed for my request in case there is a better way of doing what I am trying to do. Unless there is an objectively better way, please do not suggest changes. But if there is an objectively better way, changes are welcome.

Current Situation

The Packaging and Deployment scripts are always run manually

I build my app with Xojo (Win i386 & Pi), and then run the NSIS packaging script I created. The packaging script (using black magic and hackery) pulls the version of the currently built EXE and creates a windows installer with the version number in the name, and then creates various text files and a batch file. Also zips up the Pi build using an interesting powershell command.

  • The text files contains version and installer name info, used by PHP & Python scripts on the server to help with deployment, and
  • The batch file uses pscp to copy the files to the webserver (Windows) and deb staging (Pi). It then uses plink to build the deb, move it to the apt repo and update the repo.

It works, it works reliably, but it uses 5 different languages and really is a little hacky.

What has changed?

I have started deploying x64 Windows binaries, and i386 + x64 Linux binaries, in addition to i386 Windows and Raspberry Pi binaries.

The old hackery and witchcraft would continue to work, but the level of complexity would increase by orders of magnitude as the deployment processes would need to start making decisions based on a variety of different criteria.

Desired Situation

The Packaging and Deployment scripts are always run manually

I would like to use build scripts (preferred) or IDE scripts (if build scripts will not work) to take over much of the work, specifically:

  • Get the version number of the current build,
    • Create the text files that include the version number & build number (Non release version)
    • Create various other text files that will be used by the deb build system and the apt deployment system.
  • Create the bat file that will
    • Deploy to the VPS using pscp
    • Initiate the DEB build & repo update scripts
    • Perform any other work

Where I need help

I can do almost all of the above myself, I just need help with:

  1. I am about 60% sure I know how to get the version number, build path, and the name of the current build target (Got this info while checking if this had been asked, haven’t tested yet) in an IDE or build script.
  2. I have absolutely NO idea how to create a text file using build or IDE scripting, and this is primarily where I need help, please.
  3. BONUS POINTS 1: Can the build / IDE scripts run an external command, or can the build steps be coerced into running an external command? I’d prefer not to do this, but it would be useful to know.
  4. BONUS POINTS 2: Can I add an IDE script to the toolbar where the Run, Build and other buttons currently live?


If anyone else is interested in this, let me know and I’ll find a way / place / motivation to share the entire solution when done.


Jason D

EDIT: Found out about the following, which I shall be testing soon (This note is for myself and others who come across this while googling).



Call SaveText("G:\Test.txt", "Hello, World!")

Not sure if the documentation is just hard to find, or if I didn’t search properly. I only found this while looking for more info on doShellCommand…

It seems I found everything I needed. The IDE Scripting and Build scripting documentation is there, but for me it was insanely hard to find.

I’d delete the topic, but I cannot for some reason.