Changed page "CodeSigning" by giovannibajo from 10.3.3.246*
Page URL: <http://www.pyinstaller.org/wiki/CodeSigning>
Diff URL: <http://www.pyinstaller.org/wiki/CodeSigning?action=diff&version=2>
Revision 2
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: CodeSigning
=========================================================================
--- CodeSigning (version: 1)
+++ CodeSigning (version: 2)
@@ -16,4 +16,36 @@
SIGNTOOL.EXE /F yourkey.pfx /P <password> /T <timestamping url> <file.exe>
}}}
-[to be continued...]
+This will work correctly with !PyInstaller's generated executable. To achieve
a broader integration, you can add this code-signing step to the .spec file,
leveraging the fact that it is a regular Python file. The following is an
example:
+
+{{{
+#!python
+# -*- mode: python -*-
+a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'),
os.path.join(HOMEPATH,'support\\useUnicode.py'), 'www.py'],
+ pathex=['D:\\test'])
+pyz = PYZ(a.pure)
+exe = EXE( pyz,
+ a.scripts,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ name=os.path.join('dist', 'www.exe'),
+ debug=True,
+ strip=False,
+ upx=False,
+ console=True )
+
+# ****************************************
+# Code-sign the generated executable
+import subprocess
+subprocess.call([
+ "SIGNTOOL.EXE",
+ "/F", "path-to-key.pfx",
+ "/P", "your-password",
+ "/T", "time-stamping url",
+ exe.name
+])
+# ****************************************
+}}}
+
+If you don't want to put your password in clear-text in the spec file, you can
even use {{{getpass.getpass()}}} to ask it interactively to the user running
the script.
-------8<------8<------8<------8<------8<------8<------8<------8<--------
* The IP shown here might not mean anything if the user is behind a proxy.
--
Pyinstaller <http://www.pyinstaller.org>
PyInstaller Project
This is an automated message. Someone at http://www.pyinstaller.org
added your email address to be notified of changes on Pyinstaller.
If it was not you, please report to http://www.pyinstaller.org.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---