Skip to content

Commit

Permalink
Corrections for build process for Win10 32-bit builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan@int3ll3ct committed Apr 2, 2017
1 parent b775633 commit 12081b5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
13 changes: 11 additions & 2 deletions build_win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ if( $git_fetch )
cd Roastero
Write-Output "cloning project..."
git clone https://github.com/Roastero/Openroast.git
if( (Test-Path ".\Openroast") -eq $false )
{
Write-Output( "failed to git clone Openroast - check git installation? Bailing." )
return
}
cd Openroast
}

Expand Down Expand Up @@ -192,8 +197,12 @@ if( $make_installer )
{
Remove-Item $pynsist_filename
}
# find and replace %VERSION% string with $version
(Get-Content pynsist_installer.cfg).replace('%VERSION%', $version) | Set-Content $pynsist_filename
# find and replace %VERSION% string with $version, %OS_BITNESS% string with $os_bitness
#(Get-Content pynsist_installer.cfg).replace('%VERSION%', $version) | Set-Content $pynsist_filename
(Get-Content pynsist_installer.cfg) | Foreach-Object {
$_ -replace '%VERSION%', $version `
-replace '%OS_BITNESS%', $os_bitness.ToString() `
} | Set-Content $pynsist_filename
# make the installer package
pynsist $pynsist_filename
Remove-Item $pynsist_filename
Expand Down
14 changes: 9 additions & 5 deletions docs/wiki/developers_building_a_distributable_pkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ Alternately, if you already have git installed, you should clone the Openroast p
3. Start a PowerShell command prompt. You need to launch PowerShell with the "Run as Administrator" option. One way to do this is to type PowerShell in the search bar, then right-click on the PowerShell app icon that appears, and select "Run as Administrator".
4. We must set up elevated privileges to run the scripts in this PowerShell window. The easiest way to achieve this is to enter the command `Set-ExecutionPolicy RemoteSigned`. This allows local scripts to run unsigned.
5. In the PowerShell window, cd to where you've placed the build_win.ps1 script. (If you've cloned the Openroast project already, the file is in the project root folder.)
6. Type `build_win.ps1 -tool_install -python_build_tool_install` and press Enter. The following things will happen:
6. Type `build_win.ps1 -tool_install` and press Enter. The following things will happen:
1. installer downloads for python 3.5 for Windows, git, and NSIS. (Note that the git installer insists on re-installing git every time. If this is something you want to avoid, you should modify build_win.ps1 to not download nor install git.)
2. Install python 3.5 for Windows, git, and NSIS
3. Install a couple of python-based tools. Note that if this fails (probably because you've just installed python 3.5), you may need to close the PowerShell window and open a new one, and re-invoke the script with `build_win.ps1 -python_build_tool_install`.
7. You are now in a position to fetch the source code from github, if you haven't done so already.

## 2. Getting the source code
Expand All @@ -39,17 +38,22 @@ Assuming you have a PowerShell window opened to the directory of interest as dir
1. At the Power Shell prompt, type `build_win.ps1 -git_fetch` and press Enter. You are now fetching the head of the master branch. (To fetch a different branch, type `build_win.ps1 -branch_name <name> -git_fetch` instead, where <name> is the name of the branch you want to fetch.)
2. You now have the code locally. You'll want to `cd Roastero/Openroast` and continue working from there.

## 3. Incrementing the version number
## 3. Getting project dependencies

1. Type `build_win.ps1 -python_build_tool_install` and press Enter. The following things will happen:
1. Install a couple of python-based tools. Note that if this fails (probably because you've just installed python 3.5), you may need to close the PowerShell window and open a new one, and re-invoke the script with `build_win.ps1 -python_build_tool_install`.

## 4. Incrementing the version number

*This part of the script does not currently work, as bumpversion does not execute properly from PowerShell in Windows. Tagging and versioning is operated from Linux at the moment, and the Windows build cannot successfully change the version string and tag the source. There is no plan to fix bumpversion execution in the Windows script.*

In some instances, you may want to increment some part of the version number. The bumpversion utility is used to perform version number incrementing. Since a release will typically involve multiple platforms (Windows, Mac OS, Linux source install...), it is recommended that the maintainer learn to use the bumpversion utility outside of the build script process, before starting to create installer builds.

## 4. Creating a Windows Installer
## 5. Creating a Windows Installer

Assuming you're in PowerShell and currently in the `[YourWhateverFolderPath]\Roastero\Openroast` directory, you can create an installer build by typing `build_win.ps1 -make_installer` and pressing Enter. The EXE-based installer will be created in the folder `[YourWhateverFolderPath]\Roastero\Openroast\build\nsis`. You'll want to test this installer on a separate Windows machine to verify functionality.

## 5. Posting the installer on Github
## 6. Posting the installer on Github

At this point, you have an installer EXE that you believe is functional and ready for distribution.

Expand Down
2 changes: 1 addition & 1 deletion pynsist_installer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ icon=openroast\static\icons\openroast-windows.ico

[Python]
version=3.5.3
bitness=64
bitness=%OS_BITNESS%
format=bundled

[Include]
Expand Down

0 comments on commit 12081b5

Please sign in to comment.