Skip to content

Commit

Permalink
closing in on getting a working installer
Browse files Browse the repository at this point in the history
  • Loading branch information
ConceptJunkie committed Jan 24, 2024
1 parent 6671837 commit ed86e22
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 267 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ rpn/rpndata/rpnChilada_user_functions.cfg.backup
rpn/rpndata/rpnChilada_user_functions.cfg

# obsolete Skyfield data files

rpn/rpndata/de405.bsp
rpn/rpndata/de421.bsp
rpn/rpndata/deltat.data
Expand All @@ -236,7 +235,6 @@ rpn/rpndata/deltat.old1.data
rpn/rpndata/Leap_Second.old1.dat

# Skyfield data files

rpn/rpndata/de421.bsp
rpn/rpndata/finals2000A.all

Expand All @@ -245,8 +243,10 @@ rpn/rpndata/finals2000A.all
.vscode

# RPN user data files

rpn/rpndata/rpnChilada_user_variables.cfg.backup
rpn/rpndata/rpnChilada_user_config.cfg
rpn/rpndata/rpnChilada_user_config.cfg.backup
rpn/rpndata/rpnChilada_user_variables.cfg

# RPN prime number data files
rpn/*.txt
3 changes: 1 addition & 2 deletions BackupRPN.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ iff "%1" == "" then
endiff

rem set VERSION=%@execstr[grep "PROGRAM_VERSION " rpn\rpnVersion.py | cut -d' ' -f3 | tr -d -c 01234567890.]
set RPN_FILES=__init__.py;rpn*.py;makeHelp.py;makeRPNPrimes.py;makeUnits.py;setup_rpn.py;test*.py;profile*.py;rpn.ico;rpn32.iss;rpn64.iss;BuildRPN.bat;BuildRPNInstaller.bat;requirements.txt;setup.cfg;MANIFEST.in;setup.py;unpickle.py;preparePrimeData.py;BackupRPN.bat;rpn.py;makeHelp.py;makeUnits.py;preparePrimes.py;testRPN.py;README.md;pylintrc
set RPN_FILES=__init__.py;rpn*.py;makeHelp.py;makeRPNPrimes.py;makeUnits.py;setup_rpn.py;test*.py;profile*.py;rpn.ico;rpn64.iss;BuildRPN.bat;BuildRPNInstaller.bat;BuildRPNExecutable.bat;requirements.txt;setup.cfg;MANIFEST.in;setup.py;unpickle.py;preparePrimeData.py;BackupRPN.bat;rpn.py;makeHelp.py;makeUnits.py;preparePrimes.py;testRPN.py;README.md;pylintrc;BuildRPNExecutable.bat;BuildRPNInstaller.bat;BackupRPN.bat;BuildRPNWheel.bat

echo %VERSION

Expand Down Expand Up @@ -48,7 +48,6 @@ cd units
for /t; %TARGET_DIR in (%1) if exist %TARGET_DIR .and. isdir %TARGET_DIR copy rpn*.py %TARGET_DIR%\rpn\units
cd ..


cd util
for /t; %TARGET_DIR in (%1) if exist %TARGET_DIR .and. isdir %TARGET_DIR copy rpn*.py %TARGET_DIR%\rpn\util
cd ..
Expand Down
21 changes: 1 addition & 20 deletions buildRPNExecutable.bat
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
rem TCC script for building the RPN installer

setlocal

echos VERSION= > version.txt
type rpn\rpnVersion.py | grep PROGRAM_VERSION | cut -d"'" -f2 >> version.txt

set /r version.txt
set TCL_LIBRARY=C:\app\python38\tcl\tcl8.6
set TK_LIBRARY=C:\app\python38\tcl\tk8.6

python setup_rpn.py build_exe

copy rpn\rpndata\finals2000A.all build\exe.win-amd64-3.9\
copy rpn\rpndata\de421.bsp build\exe.win-amd64-3.9\

del version.txt

endlocal

pyinstaller --onefile rpn.py
20 changes: 7 additions & 13 deletions buildRPNInstaller.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,20 @@ rem TCC script for building the RPN installer

setlocal

if not exist mkdir dist
if not exist installer_dist mkdir installer_dist

if exist version.txt rm version.txt

echos VERSION= > version.txt
type rpn\rpnVersion.py | grep PROGRAM_VERSION | cut -d"'" -f2 >> version.txt
type rpn\rpnVersion.py | grep "PROGRAM_VERSION =" | cut -d"'" -f2 >> version.txt

set /r version.txt

iff %_X64 eq 1 then
"%PROG32_DIR%\Inno Setup 5\ISCC.exe" rpn64.iss
move Output\setup_rpnChilada.exe "dist\setup_rpnChilada-%VERSION%-win64.exe"
else
copy msvcp100-win32.dll build\exe.win32-3.6\msvcp100.dll
"%PROG32_DIR%\Inno Setup 5\ISCC.exe" rpn32.iss
move Output\setup_rpnChilada.exe "dist\setup_rpnChilada-%VERSION%-win32.exe"
endiff

rem del /sxyz /nt build
rem del /sxyz /nt Output
"%PROG32_DIR%\Inno Setup 6\ISCC.exe" rpn64.iss
move Output\setup_rpnChilada.exe "dist\setup_rpnChilada-%VERSION%-win64.exe"

del /sxyz /nt build
del /sxyz /nt Output

del version.txt

Expand Down
File renamed without changes.
37 changes: 37 additions & 0 deletions rpn.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['rpn.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='rpn',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
8 changes: 5 additions & 3 deletions rpn/rpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from rpn.util.rpnAliases import OPERATOR_ALIASES
from rpn.util.rpnDebug import debugPrint
from rpn.util.rpnGenerator import RPNGenerator
from rpn.util.rpnUtils import getDataPath

from rpn.time.rpnDateTime import formatDateTime

Expand Down Expand Up @@ -682,14 +683,15 @@ def main( ):
os.chdir( getUserDataPath( ) ) # SkyField doesn't like running in the root directory

if not unitsFile.is_file( ):
print( 'Please run "rpnMakeUnits" (or makeUnits.py) to initialize the unit conversion data files.' )
print( f'unit conversion data files not found in {getDataPath()}' )
print( 'Please run makeUnits.py to initialize the unit conversion data files.' )
sys.exit( 0 )

helpFile = Path( getUserDataPath( ) + os.sep + 'help.pckl.bz2' )

if not helpFile.is_file( ):
debugPrint('Expected help file location: ', helpFile)
print( 'Please run "makeHelp" to initialize the help files.' )
print( f'help files not found in {getDataPath()}' )
print( 'Please run makeHelp.py to initialize the help files.' )
sys.exit( 0 )

try:
Expand Down
2 changes: 1 addition & 1 deletion rpn/util/rpnUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def getSourcePath( ):
def getDataPath( ):
'''Returns the path for the data files.'''
if getattr( sys, 'frozen', False ):
dataPath = os.path.dirname( sys.executable )
dataPath = os.path.dirname( sys.executable ) + os.sep + g.dataDir
else:
dataPath = os.path.dirname( os.path.realpath( __file__ ) ) + os.sep + '..' + os.sep + g.dataDir

Expand Down
83 changes: 0 additions & 83 deletions rpn32.iss

This file was deleted.

77 changes: 30 additions & 47 deletions rpn64.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "rpnChilada"
#define MyAppVersion "8.0.0"
#define MyAppVersion "9.0.beta1"
#define MyAppPublisher "Rick Gutleber"
#define MyAppURL "https://github.com/ConceptJunkie/rpn"
#define MyAppExeName "rpn.exe"
#define BuildDir="c:\sys\ut\rpn\build\exe.win-amd64-3.7"
#define BuildDir="c:\sys\ut\rpn\"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
Expand Down Expand Up @@ -35,54 +35,37 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "{#BuildDir}\rpn.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\dist\rpn.exe"; DestDir: "{app}"; Flags: ignoreversion

Source: "{#BuildDir}\lib\gmpy2.cp37-win_amd64.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\library.zip"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\MSVCP140.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\VCRUNTIME140.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\sqlite3.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\pyexpat.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\python37.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\pywintypes37.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\select.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\unicodedata.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\win32api.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\win32evtlog.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\_bz2.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\_ctypes.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\_decimal.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\_hashlib.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\_lzma.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\_socket.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\lib\_ssl.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\help.pckl.bz2"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\units.pckl.bz2"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\unit_conversions.pckl.bz2"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\unit_help.pckl.bz2"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\unit_names.pckl.bz2"; DestDir: "{app}\rpndata"; Flags: ignoreversion

Source: "{#BuildDir}\help.pckl.bz2"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\units.pckl.bz2"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\unit_conversions.pckl.bz2"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\unit_help.pckl.bz2"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\unit_names.pckl.bz2"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\balanced_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\cousin_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\double_balanced_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\huge_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\isolated_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\large_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\quad_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\quint_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\sext_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\sexy_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\sexy_quadruplets.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\sexy_triplets.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\small_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\sophie_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\super_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\triplet_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\triple_balanced_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\twin_primes.cache"; DestDir: "{app}\rpndata"; Flags: ignoreversion

Source: "{#BuildDir}\balanced_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\cousin_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\double_balanced_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\isolated_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\large_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\quad_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\quint_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\sext_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\sexy_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\sexy_quadruplets.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\sexy_triplets.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\small_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\sophie_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\super_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\triplet_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\triple_balanced_primes.cache"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\twin_primes.cache"; DestDir: "{app}"; Flags: ignoreversion

Source: "{#BuildDir}\de421.bsp"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\finals2000A.all"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\de421.bsp"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\de405.bsp"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\deltat.data"; DestDir: "{app}\rpndata"; Flags: ignoreversion
Source: "{#BuildDir}\rpn\rpndata\deltat.preds"; DestDir: "{app}\rpndata"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Expand Down
Loading

0 comments on commit ed86e22

Please sign in to comment.