Table of Contents
Windows - Building PTerm (Part 2)
Preparing the Code Headers
Environment
Set the environment variable in your USER or SYSTEM environment:
SET PYTHONIOENCODING=UTF-8
Failing to do so will result in warnings from the utility function.
Once preparation of the environment is complete, the next (somewhat optional) steps leading to a successful build are:
PtermKeyTabs.h
PtermVersion.h
wxversion.h
This is done using the utility functions from the command line:
cd /d <MyRepositoryFolder>
Then issue the following Case Sensitive commands (This only needs to be done ONCE as long as the underlying libraries and version numbers have not been changed.):
python -m PTDevUtils make.ptermversion.h -r src/pterm.rc --wxheaderfn src/wxversion.h --ptheaderfn src/PtermVersion.h python -m PTDevUtils make.ptermkeytabs.h --ptkeytabsfn src/PtermKeyTabs.h python -m PTDevUtils make.wxversion.h -p pterm7.vcxproj --wxheaderfn src/wxversion.h
Note: Python applications automatically change the directory path separators into the correct ones for the platform - either forward or backward slashes will work.
What's Happening
PTerm's headers are used the the application for various core functions and in assorted displays.
- Header
src/PtermKeyTabs.h
is the key translation table for all data transformation in the PTerm system. ConvertingPLATO
character encoding,CDC
character encoding,UNICODE
character transformation, Cut/Paste operations, and more, are all controlled by this file. This header is not very volatile so if this step is accidentally skipped, the existing file stored in the repository should be sufficient.
- Headers
src/PtermVersion.h
andsrc/wxversion.h
are used in various information displays including the โAboutโ box to convey the current build information which may be needed for defect reports. These files are supplied based on the currently supported libraries. If this step is accidentally skipped, the existing files stored in the repository should be sufficient, but it may be difficult to identify the source of problems if the Repository identifier information is not kept current.
Build the Solution
Open Visual Studio by launching the file Pterm7.sln
in the repository root:
Set the Build Type to Release
and the Architecture to x64
, and press F6
(Build Solution).
After a couple of minutes, the following will appear:
If no errors appeared - the build was successful!
At this point the application has been built but cannot be executed until all of the proper libraries are positioned.
Copy the files from:
<MyLibsPath>\libs\SDL2-2.32.4\lib\x64
into the newly built directory<MyRepositoryPath>\x64\Release\PTerm7
<MyLibsPath>\libs\libsndfile-1.2.2-win64\bin\sndfile.dll
into the same directory<MyRepositoryPath>\x64\Release\PTerm7
<MyRepositoryPath>\prototypes\ptermhelp.mte
into the same directory<MyRepositoryPath>\x64\Release\PTerm7
Success
You are now ready to launch the application!
Launching <MyRepositoryPath>\x64\Release\PTerm7\PTerm7.exe
should prompt you to select the target system.
Luckily - These final steps can be automatically performed (including the build of the installer applications) by activating the post-build step in the properties display:
When this feature is activated - the correct files will be copied from the development libraries into the right position to be consumed by the InnoSetup
installation compiler.
Before the InnoSetup
compiler runs it will display the compilation steps in an editor window. The installer will not be built until this window is closed. Once closed, InnoSetup
will deposit the resulting installer file in the directory: <RepositoryFolder>\installers\PTerm7_7.0.2.0_x64R_Setup.exe