Skip to content

Commit c4dce8c

Browse files
committed
Beta windows installer, rename fitparse_mod and fix chdir('')
1 parent 2e56da1 commit c4dce8c

14 files changed

+132
-1
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*~
2+
*.pyc
3+
images/tmp
4+
installer/*.exe
5+
build/
6+
dist/

fitfileanalyses.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,11 @@ def OnClose(event):
386386
import sys
387387
if len(sys.argv) >= 1:
388388
(CodePath, PyFileName) = os.path.split(sys.argv[0])
389-
os.chdir(CodePath)
389+
print (CodePath, PyFileName)
390+
391+
if CodePath != '':
392+
os.chdir(CodePath)
393+
390394
win.SetStatusText(os.getcwd(), number=0)
391395
AutoFillConfigFile(CodePath)
392396
if len(sys.argv) >= 2:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/FitFiles.ico

141 KB
Binary file not shown.

images/FitFiles.svg

+1
Loading

images/svg2ico.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
import sys
5+
import subprocess
6+
7+
sizes = (16, 24, 32, 48, 64, 96, 128, 256)
8+
9+
svg = sys.argv[1]
10+
basename, extension = os.path.splitext(svg)
11+
ico = basename + '.ico'
12+
tmp_names = []
13+
14+
for size in sizes:
15+
png = 'tmp/' + str(size) + '.png'
16+
tmp_names.append(png)
17+
subprocess.call(['inkscape', '-z', '-e', png, '-w', str(size), '-h', str(size), svg])
18+
19+
subprocess.call(['convert'] + tmp_names + [ico])
20+

installer/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
## Install dependencies
3+
4+
`conda install numpy scipy matplotlib wxPython`
5+
`conda install pip`

installer/create_installer.bat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyinstaller --clean -y --noupx --windowed -D --icon images\FitFiles.ico fitfileanalyses.py

installer/installer.nsi

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
;--------------------------------
2+
;Include Modern UI
3+
4+
!include "MUI2.nsh"
5+
6+
;--------------------------------
7+
;General
8+
9+
;Name and file
10+
Name "FitFiles"
11+
OutFile "Install FitFiles.exe"
12+
13+
;Default installation folder
14+
InstallDir "$LOCALAPPDATA\FitFiles"
15+
16+
;Get installation folder from registry if available
17+
InstallDirRegKey HKCU "Software\FitFiles" ""
18+
19+
;Request application privileges for Windows Vista
20+
RequestExecutionLevel user
21+
22+
; Tried them all and this was best
23+
SetCompressor /SOLID lzma
24+
25+
;--------------------------------
26+
;Interface Settings
27+
28+
!define MUI_ABORTWARNING
29+
!define MUI_ICON "..\images\FitFiles.ico"
30+
31+
;--------------------------------
32+
;Pages
33+
34+
!insertmacro MUI_PAGE_WELCOME
35+
;!insertmacro MUI_PAGE_LICENSE "..\..\LICENSE"
36+
!insertmacro MUI_PAGE_COMPONENTS
37+
!insertmacro MUI_PAGE_DIRECTORY
38+
!insertmacro MUI_PAGE_INSTFILES
39+
!insertmacro MUI_PAGE_FINISH
40+
41+
!insertmacro MUI_UNPAGE_WELCOME
42+
!insertmacro MUI_UNPAGE_CONFIRM
43+
!insertmacro MUI_UNPAGE_INSTFILES
44+
!insertmacro MUI_UNPAGE_FINISH
45+
46+
;--------------------------------
47+
;Languages
48+
49+
!insertmacro MUI_LANGUAGE "English"
50+
51+
;--------------------------------
52+
;Installer Sections
53+
54+
Section "FitFiles" SecDummy
55+
SetOutPath "$INSTDIR"
56+
File /r "..\dist\fitfileanalyses\*"
57+
58+
59+
WriteRegStr HKCU "Software\FitFiles" "" $INSTDIR
60+
61+
WriteUninstaller "$INSTDIR\Uninstall.exe"
62+
63+
CreateDirectory "$SMPROGRAMS\FitFiles"
64+
CreateShortCut "$SMPROGRAMS\FitFiles\FitFiles.lnk" "$INSTDIR\fitfileanalyses.exe" ""
65+
CreateShortCut "$SMPROGRAMS\FitFiles\Uninstall FitFiles.lnk" "$INSTDIR\Uninstall.exe" ""
66+
CreateShortCut "$DESKTOP\FitFiles.lnk" "$INSTDIR\fitfileanalyses.exe" ""
67+
SectionEnd
68+
69+
;--------------------------------
70+
;Descriptions
71+
72+
;Language strings
73+
LangString DESC_SecDummy ${LANG_ENGLISH} "FitFiles"
74+
75+
;Assign language strings to sections
76+
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
77+
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
78+
!insertmacro MUI_FUNCTION_DESCRIPTION_END
79+
80+
;--------------------------------
81+
;Uninstaller Section
82+
83+
Section "Uninstall"
84+
Delete "$INSTDIR\Uninstall.exe"
85+
Delete "$SMPROGRAMS\FitFiles\FitFiles.lnk"
86+
Delete "$SMPROGRAMS\FitFiles\Uninstall FitFiles.lnk"
87+
RMDir "$SMPROGRAMS\FitFiles"
88+
Delete "$DESKTOP\FitFiles.lnk"
89+
90+
RMDir /r "$INSTDIR\FitFiles"
91+
RMDir "$INSTDIR"
92+
93+
DeleteRegKey /ifempty HKCU "Software\FitFiles"
94+
SectionEnd

0 commit comments

Comments
 (0)