Re: [Python-Dev] Python Launcher for Windows (PEP 397) needs testing!

2011-07-07 Thread Gertjan Klein
Vinay Sajip wrote:

The C implementation of the PEP 397-compatible Python Launcher for Windows has
come along nicely in the last few days, and now reached a point where it would
benefit from some testing by interested python-dev members.

I've gotten the sources from:

https://bitbucket.org/vinay.sajip/pylauncher

GUILauncher and CLILauncher refuse to build with Visual C++ 2008 Express
Edition (using Launchers.sln):

.\CLILauncher.rc(97) : error RC2135 : file not found:
C:\Users\Vinay\Projects\Launchers\launcher.ico

This is on Windows XP Pro, 32 bit.

There are a few compilation warnings as well:

.\launcher.c(59) : warning C4996: '_wgetenv': This function or variable
may be unsafe. Consider using _wdupenv_s instead. To disable
deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

Associator builds (with the same warning displayed above). When checking
it's dependencies, I see it depends on MSVCR90.DLL. You've mentioned
that you use only plain C and Win32 APIs; would it be possible to
remove this dependency? That would make it possible to copy the
executable to a directory on the PATH, without having to worry about
installing the C(++) runtime.

Regards,
Gertjan.


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python Launcher for Windows (PEP 397) needs testing!

2011-07-07 Thread Paul Moore
On 6 July 2011 19:31, Vinay Sajip vinay_sa...@yahoo.co.uk wrote:
 The C implementation of the PEP 397-compatible Python Launcher for Windows has
 come along nicely in the last few days, and now reached a point where it would
 benefit from some testing by interested python-dev members. Points of note:

 1. As well as source available on

 https://bitbucket.org/vinay.sajip/pylauncher

 there are built 32- and 64-bit msi files at

 https://bitbucket.org/vinay.sajip/pylauncher/downloads

I just tried to install launcher.msi, and it seems to have done nothing.

This is on Windows XP SP3 with Python 2.7 installed. It's a corporate
build so there may be funny security limits hindering things, but I
have admin rights and normally don't have problems.

msiexec /i launcher.msi /l* launcher.log gives the following log file.
I can't see any errors in there, but all those return code 1 entries
look odd (surely 0 is success and 1 failure as with OS commands?)

Paul.

=== Logging started: 07/07/2011  15:01:42 ===
Action 15:01:42: INSTALL.
Action start 15:01:42: INSTALL.
Action 15:01:42: ProgramFilesFolder.9CA91B9B_69A1_494B_A200_44AA4D54BC92.
Action start 15:01:42: ProgramFilesFolder.9CA91B9B_69A1_494B_A200_44AA4D54BC92.
Action ended 15:01:42:
ProgramFilesFolder.9CA91B9B_69A1_494B_A200_44AA4D54BC92. Return value
1.
Action 15:01:42: ValidateProductID.
Action start 15:01:42: ValidateProductID.
Action ended 15:01:42: ValidateProductID. Return value 1.
Action 15:01:42: CostInitialize. Computing space requirements
Action start 15:01:42: CostInitialize.
Action ended 15:01:42: CostInitialize. Return value 1.
Action 15:01:42: FileCost. Computing space requirements
Action start 15:01:42: FileCost.
Action ended 15:01:42: FileCost. Return value 1.
Action 15:01:42: CostFinalize. Computing space requirements
Action start 15:01:42: CostFinalize.
Action ended 15:01:42: CostFinalize. Return value 1.
Action 15:01:42: ExecuteAction.
Action start 15:01:42: ExecuteAction.
Action start 15:01:42: INSTALL.
Action start 15:01:42: ProgramFilesFolder.9CA91B9B_69A1_494B_A200_44AA4D54BC92.
Action ended 15:01:42:
ProgramFilesFolder.9CA91B9B_69A1_494B_A200_44AA4D54BC92. Return value
1.
Action start 15:01:42: ValidateProductID.
Action ended 15:01:42: ValidateProductID. Return value 1.
Action start 15:01:42: CostInitialize.
Action ended 15:01:42: CostInitialize. Return value 1.
Action start 15:01:42: FileCost.
Action ended 15:01:42: FileCost. Return value 1.
Action start 15:01:42: CostFinalize.
Action ended 15:01:42: CostFinalize. Return value 1.
Action start 15:01:42: InstallValidate.
Action ended 15:01:42: InstallValidate. Return value 1.
Action start 15:01:42: InstallInitialize.
Action ended 15:01:42: InstallInitialize. Return value 1.
Action start 15:01:42: ProcessComponents.
Action ended 15:01:42: ProcessComponents. Return value 1.
Action start 15:01:42: UnpublishFeatures.
Action ended 15:01:42: UnpublishFeatures. Return value 1.
Action start 15:01:42: RemoveRegistryValues.
Action ended 15:01:42: RemoveRegistryValues. Return value 1.
Action start 15:01:42: RemoveFiles.
Action ended 15:01:42: RemoveFiles. Return value 0.
Action start 15:01:42: InstallFiles.
Action ended 15:01:42: InstallFiles. Return value 1.
Action start 15:01:42: WriteRegistryValues.
Action ended 15:01:42: WriteRegistryValues. Return value 1.
Action start 15:01:42: RegisterUser.
Action ended 15:01:42: RegisterUser. Return value 0.
Action start 15:01:42: RegisterProduct.
Action ended 15:01:42: RegisterProduct. Return value 1.
Action start 15:01:42: PublishFeatures.
Action ended 15:01:42: PublishFeatures. Return value 1.
Action start 15:01:42: PublishProduct.
Action ended 15:01:42: PublishProduct. Return value 1.
Action start 15:01:42: InstallFinalize.
Action ended 15:01:43: InstallFinalize. Return value 1.
Action ended 15:01:43: INSTALL. Return value 1.
Property(S): TARGETDIR = D:\
Property(S): SourceDir = D:\Downloads\
Property(S): Manufacturer = Vinay Sajip
Property(S): ProductCode = {298B5D62-1287-427F-B8D9-B44D605F8F6B}
Property(S): ProductLanguage = 1033
Property(S): ProductName = Python Launcher
Property(S): ProductVersion = 1.0.0.0
Property(S): UpgradeCode = {36B0A82E-0B4E-47CD-895B-FD4EC726B3AC}
Property(S): ARPPRODUCTICON = arpicon
Property(S): ProgramFilesFolder.9CA91B9B_69A1_494B_A200_44AA4D54BC92 =
C:\Program Files\
Property(S): ProgDir.9CA91B9B_69A1_494B_A200_44AA4D54BC92 = C:\Program
Files\Python Launcher\
Property(S): PackageCode = {C9DC0563-F67F-4F32-A0B1-1D77B10AD2AF}
Property(S): ProductState = 5
Property(S): ProductToBeRegistered = 1
Property(S): CURRENTDIRECTORY = D:\Data
Property(S): CLIENTUILEVEL = 0
Property(S): CLIENTPROCESSID = 5636
Property(S): PRODUCTLANGUAGE = 1033
Property(S): USERNAME = Atos Origin
Property(S): COMPANYNAME = Atos Origin
Property(S): ROOTDRIVE = D:\
Property(S): EXECUTEACTION = INSTALL
Property(S): ACTION = INSTALL
Property(S): INSTALLLEVEL = 1
Property(S): SECONDSEQUENCE = 1
Property(S): _MSI_FEATURE_SELECTION = _NONE_
Property(S): 

Re: [Python-Dev] Python Launcher for Windows (PEP 397) needs testing!

2011-07-07 Thread Paul Moore
On 7 July 2011 15:24, Vinay Sajip vinay_sa...@yahoo.co.uk wrote:
 Hi Paul,

 Thanks for trying it out. If it installs successfully, nothing will appear to
 happen, Unix-style :-)

 There should be files installed in c:\Program Files\Python Launcher:

 py.exe, pyw.exe, py.ini

 and there should be registry entries in HKEY_CLASSES_ROOT\Python.File,
 Python.NoConFile and Python.CompiledFile which point to those installed files.

 Can you confirm if this is the case?

Ah, yes. This is what has happened.

In that case, some points:

1. A silent by default installer like this is not very usual in the
Windows world, I'd have expected a confirmation dialog at least. For
silent installs, msiexec /silent is available.

2. I thought the idea from the PEP was to put py.exe/pyw.exe into a
system location which is already on the PATH (likely
windows\system32, or whatever the 64-bit equivalent is). That way, py
or py -3 and similar can be used to launch the interactive
interpreter.

3. Given that you're not installing in system32, you should add the
install dir to PATH (and remove it on uninstall :-)) That's definitely
a second-best option, though, so I'd rather you didn't, but installed
in system32 instead :-)

4. If you embed both of the py.ico and pyc.ico files into the launcher
exes, you wouldn't need to have them as separate files (I see py.ico
is embedded already) and so the footprint becomes 2 exes and an ini
file. That might be a bit more palatable for people who are
uncomfortable with installing into somewhere like system32.

Otherwise it looks great.

 P.S. I didn't copy the list, as if there is some problem which requires going
 back and forth a bit, it would be OT for the list.

Agreed. I've added the list back in as the above is really design
feedback, and so would benefit from comments from the list.

Paul.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python Launcher for Windows (PEP 397) needs testing!

2011-07-07 Thread Vinay Sajip
Hi Gertjan,

Thanks for trying it.

 .\CLILauncher.rc(97) : error RC2135 : file not found:
 C:\Users\Vinay\Projects\Launchers\launcher.ico

Somewhere there's an absolute path where it should be relative - I'll get on it.

 There are a few compilation warnings as well:
 
 .\launcher.c(59) : warning C4996: '_wgetenv': This function or variable
 may be unsafe. Consider using _wdupenv_s instead. To disable
 deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

This is a security related warning which I think can be ignored - we only ever
read environment values, never write them, so making a private copy via _wdupenv
isn't really needed IMO. I don't disable the warning because it would disable
all security-related warnings.
 
 Associator builds (with the same warning displayed above). When checking
 it's dependencies, I see it depends on MSVCR90.DLL. You've mentioned
 that you use only plain C and Win32 APIs; would it be possible to
 remove this dependency? That would make it possible to copy the
 executable to a directory on the PATH, without having to worry about
 installing the C(++) runtime.

I noticed this too, and later builds of associator have the library linked in
statically.

If you get any more issues, you can post them on the BitBucket issue tracker -
they are probably OT for here, unless design/PEP related.

Regards,

Vinay Sajip



___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python Launcher for Windows (PEP 397) needs testing!

2011-07-07 Thread Vinay Sajip
Paul Moore p.f.moore at gmail.com writes:

 In that case, some points:
 
 1. A silent by default installer like this is not very usual in the
 Windows world, I'd have expected a confirmation dialog at least. For
 silent installs, msiexec /silent is available.

Agreed, a success message is probably a good idea for the standalone launcher.
The installer is a bit tentative because (a) the PEP is still
under discussion, and (b) I don't know exactly how launcher installation
will work as part of Python installation. 
 
 2. I thought the idea from the PEP was to put py.exe/pyw.exe into a
 system location which is already on the PATH (likely
 windows\system32, or whatever the 64-bit equivalent is). That way, py
 or py -3 and similar can be used to launch the interactive
 interpreter.

This can always be changed in the installer - the PEP says install in System32
if possible, and I'm not yet sure of all the security/permissions implications
of that. The current location should be usable for test purposes, even if you
have to manually add to the path for now.

 3. Given that you're not installing in system32, you should add the
 install dir to PATH (and remove it on uninstall ) That's definitely
 a second-best option, though, so I'd rather you didn't, but installed
 in system32 instead 

I'll look at changing the installer builds to do this.

 4. If you embed both of the py.ico and pyc.ico files into the launcher
 exes, you wouldn't need to have them as separate files (I see py.ico
 is embedded already) and so the footprint becomes 2 exes and an ini
 file. That might be a bit more palatable for people who are
 uncomfortable with installing into somewhere like system32.
 
 Otherwise it looks great.
 

Thanks for the feedback. Please log any implementation-related issues on the
BitBucket tracker.

Regards,

Vinay Sajip

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Python Launcher for Windows (PEP 397) needs testing!

2011-07-06 Thread Vinay Sajip
The C implementation of the PEP 397-compatible Python Launcher for Windows has
come along nicely in the last few days, and now reached a point where it would
benefit from some testing by interested python-dev members. Points of note:

1. As well as source available on

https://bitbucket.org/vinay.sajip/pylauncher

there are built 32- and 64-bit msi files at

https://bitbucket.org/vinay.sajip/pylauncher/downloads

Please remember that this is beta software. While it appears stable, I've
tested in virtual machines (WinXP 32-bit, Win7 32-bit and 64-bit) which I can
readily restore from backup. There are also msm files which could be used to
e.g. integrate with the Python msi files, if approved, at some later date.

2. On installation, any existing associations are saved, and restored when the
launcher is uninstalled (this is done automatically by Windows Installer).

3. On uninstallation, if there are Pythons installed and no associations, a
dialog pops up listing all the installed Pythons and offering the user the
chance to associate one of the Pythons with the Python extensions. The user
can choose to associate or not, but once they choose an association, then that
association will always be there unless the launcher is reinstalled (in which
case it takes over the association while it's still installed, and restores
the previous one when it's uninstalled).

4. I've tried to cover all of the points in the PEP. There is a test suite -
while this appears to be small (7 tests) the individual shebangs are all
tested, as are the customisable commands etc. However, I'm sure some of you
will break it ;-)

5. I used WiX to build the msm/msi files, but that's only because of increased
familiarity over msilib. The build procedure could switch over to msilib at
some later date. All the other code is just plain C and Win32 APIs (gosh -
takes me back! Window procedures, anyone?). The code builds with Visual Studio
and also Visual Studio Express (C++ edition).

Regards,

Vinay Sajip

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com