@@ -75,6 +75,20 @@ def cleanup_build_dirs(zips = False):
7575 os .remove (full_zip_dir )
7676 print "Successfully deleted " + full_zip_dir
7777
78+ ### Ask user for windows signing info
79+ ###########################################################
80+ windows_signing = False
81+ windows_pfx_path = ''
82+ windows_pfx_password = ''
83+ if LOCAL_OS == WINDOWS :
84+ is_signing = raw_input ("Will you be signing the app? (Y/n): " )
85+ if is_signing .lower () != 'n' :
86+ windows_signing = True
87+ windows_pfx_path = raw_input ("Path to PFX file: " )
88+ while not os .path .isfile (windows_pfx_path ):
89+ windows_pfx_path = raw_input ("PFX file not found. Re-enter: " )
90+ windows_pfx_password = raw_input ("Password for the PFX file: " )
91+
7892### Ask user for the hub directory
7993###########################################################
8094hub_dir = raw_input ("Enter path to the HUB: " )
@@ -168,6 +182,18 @@ def cleanup_build_dirs(zips = False):
168182 else :
169183 print "Successfully signed app."
170184
185+ ### On Windows, just sign the app
186+ ###########################################################
187+ if windows_signing :
188+ exe_dir = os .path .join (build_dir , "OpenBCI_GUI.exe" )
189+ assert (os .path .isfile (exe_dir ))
190+ try :
191+ subprocess .check_call (["SignTool" , "sign" , "/f" , windows_pfx_path , "/p" ,\
192+ windows_pfx_password , "/tr" , "http://tsa.starfieldtech.com" , "/td" , "SHA256" , exe_dir ])
193+ except subprocess .CalledProcessError as err :
194+ print err
195+ print "WARNING: Failed to sign app."
196+
171197### Zip the file
172198###########################################################
173199print "Zipping ..."
0 commit comments