Python Launcher for Windows (PEP 397) needs testing!
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
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:
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.
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
On 6 July 2011 19:31, Vinay Sajip <vinay_sajip@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
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): VersionDatabase = 200 Property(S): VersionMsi = 3.01 Property(S): VersionNT = 501 Property(S): WindowsBuild = 2600 Property(S): ServicePackLevel = 3 Property(S): ServicePackLevelMinor = 0 Property(S): MsiNTProductType = 1 Property(S): WindowsFolder = C:\WINDOWS\ Property(S): WindowsVolume = C:\ Property(S): SystemFolder = C:\WINDOWS\system32\ Property(S): System16Folder = C:\WINDOWS\system\ Property(S): RemoteAdminTS = 1 Property(S): TempFolder = C:\TEMP\ Property(S): ProgramFilesFolder = C:\Program Files\ Property(S): CommonFilesFolder = C:\Program Files\Common Files\ Property(S): AppDataFolder = D:\Documents and Settings\UK03306\Application Data\ Property(S): FavoritesFolder = D:\Documents and Settings\UK03306\Favorites\ Property(S): NetHoodFolder = D:\Documents and Settings\UK03306\NetHood\ Property(S): PersonalFolder = D:\Documents and Settings\UK03306\My Documents\ Property(S): PrintHoodFolder = D:\Documents and Settings\UK03306\PrintHood\ Property(S): RecentFolder = D:\Documents and Settings\UK03306\Recent\ Property(S): SendToFolder = D:\Documents and Settings\UK03306\SendTo\ Property(S): TemplateFolder = D:\Documents and Settings\UK03306\Templates\ Property(S): CommonAppDataFolder = D:\Documents and Settings\All Users\Application Data\ Property(S): LocalAppDataFolder = D:\Documents and Settings\UK03306\Local Settings\Application Data\ Property(S): MyPicturesFolder = D:\Documents and Settings\UK03306\My Documents\My Pictures\ Property(S): AdminToolsFolder = D:\Documents and Settings\UK03306\Start Menu\Programs\Administrative Tools\ Property(S): StartupFolder = D:\Documents and Settings\UK03306\Start Menu\Programs\Startup\ Property(S): ProgramMenuFolder = D:\Documents and Settings\UK03306\Start Menu\Programs\ Property(S): StartMenuFolder = D:\Documents and Settings\UK03306\Start Menu\ Property(S): DesktopFolder = D:\Documents and Settings\UK03306\Desktop\ Property(S): FontsFolder = C:\WINDOWS\Fonts\ Property(S): GPTSupport = 1 Property(S): OLEAdvtSupport = 1 Property(S): ShellAdvtSupport = 1 Property(S): Intel = 6 Property(S): PhysicalMemory = 2991 Property(S): VirtualMemory = 3325 Property(S): AdminUser = 1 Property(S): LogonUser = UK03306 Property(S): UserSID = S-1-5-21-1957994488-1604221776-515967899-4426 Property(S): UserLanguageID = 2057 Property(S): ComputerName = UKCNU1131P6N Property(S): SystemLanguageID = 2057 Property(S): ScreenX = 1280 Property(S): ScreenY = 1024 Property(S): CaptionHeight = 26 Property(S): BorderTop = 1 Property(S): BorderSide = 1 Property(S): TextHeight = 16 Property(S): ColorBits = 32 Property(S): TTCSupport = 1 Property(S): Time = 15:01:43 Property(S): Date = 07/07/2011 Property(S): MsiNetAssemblySupport = 2.0.50727.3053 Property(S): MsiWin32AssemblySupport = 5.1.2600.5512 Property(S): RedirectedDllSupport = 2 Property(S): Privileged = 1 Property(S): Installed = 00:00:00 Property(S): DATABASE = C:\WINDOWS\Installer\153760c.msi Property(S): OriginalDatabase = D:\Downloads\launcher.msi Property(S): UILevel = 5 Property(S): CostingComplete = 1 Property(S): OutOfDiskSpace = 0 Property(S): OutOfNoRbDiskSpace = 0 Property(S): PrimaryVolumeSpaceAvailable = 0 Property(S): PrimaryVolumeSpaceRequired = 0 Property(S): PrimaryVolumeSpaceRemaining = 0 Property(S): SOURCEDIR = D:\Downloads\ Property(S): SourcedirProduct = {298B5D62-1287-427F-B8D9-B44D605F8F6B} Action ended 15:01:43: ExecuteAction. Return value 1. Action ended 15:01:43: INSTALL. Return value 1. Property(C): TARGETDIR = D:\ Property(C): Manufacturer = Vinay Sajip Property(C): ProductCode = {298B5D62-1287-427F-B8D9-B44D605F8F6B} Property(C): ProductLanguage = 1033 Property(C): ProductName = Python Launcher Property(C): ProductVersion = 1.0.0.0 Property(C): UpgradeCode = {36B0A82E-0B4E-47CD-895B-FD4EC726B3AC} Property(C): ARPPRODUCTICON = arpicon Property(C): ProgramFilesFolder.9CA91B9B_69A1_494B_A200_44AA4D54BC92 = C:\Program Files\ Property(C): ProgDir.9CA91B9B_69A1_494B_A200_44AA4D54BC92 = C:\Program Files\Python Launcher\ Property(C): PackageCode = {C9DC0563-F67F-4F32-A0B1-1D77B10AD2AF} Property(C): ProductState = 5 Property(C): ProductToBeRegistered = 1 Property(C): CURRENTDIRECTORY = D:\Data Property(C): CLIENTUILEVEL = 0 Property(C): CLIENTPROCESSID = 5636 Property(C): PRODUCTLANGUAGE = 1033 Property(C): VersionDatabase = 200 Property(C): VersionMsi = 3.01 Property(C): VersionNT = 501 Property(C): WindowsBuild = 2600 Property(C): ServicePackLevel = 3 Property(C): ServicePackLevelMinor = 0 Property(C): MsiNTProductType = 1 Property(C): WindowsFolder = C:\WINDOWS\ Property(C): WindowsVolume = C:\ Property(C): SystemFolder = C:\WINDOWS\system32\ Property(C): System16Folder = C:\WINDOWS\system\ Property(C): RemoteAdminTS = 1 Property(C): TempFolder = C:\TEMP\ Property(C): ProgramFilesFolder = C:\Program Files\ Property(C): CommonFilesFolder = C:\Program Files\Common Files\ Property(C): AppDataFolder = D:\Documents and Settings\UK03306\Application Data\ Property(C): FavoritesFolder = D:\Documents and Settings\UK03306\Favorites\ Property(C): NetHoodFolder = D:\Documents and Settings\UK03306\NetHood\ Property(C): PersonalFolder = D:\Documents and Settings\UK03306\My Documents\ Property(C): PrintHoodFolder = D:\Documents and Settings\UK03306\PrintHood\ Property(C): RecentFolder = D:\Documents and Settings\UK03306\Recent\ Property(C): SendToFolder = D:\Documents and Settings\UK03306\SendTo\ Property(C): TemplateFolder = D:\Documents and Settings\UK03306\Templates\ Property(C): CommonAppDataFolder = D:\Documents and Settings\All Users\Application Data\ Property(C): LocalAppDataFolder = D:\Documents and Settings\UK03306\Local Settings\Application Data\ Property(C): MyPicturesFolder = D:\Documents and Settings\UK03306\My Documents\My Pictures\ Property(C): AdminToolsFolder = D:\Documents and Settings\UK03306\Start Menu\Programs\Administrative Tools\ Property(C): StartupFolder = D:\Documents and Settings\UK03306\Start Menu\Programs\Startup\ Property(C): ProgramMenuFolder = D:\Documents and Settings\UK03306\Start Menu\Programs\ Property(C): StartMenuFolder = D:\Documents and Settings\UK03306\Start Menu\ Property(C): DesktopFolder = D:\Documents and Settings\UK03306\Desktop\ Property(C): FontsFolder = C:\WINDOWS\Fonts\ Property(C): GPTSupport = 1 Property(C): OLEAdvtSupport = 1 Property(C): ShellAdvtSupport = 1 Property(C): Intel = 6 Property(C): PhysicalMemory = 2991 Property(C): VirtualMemory = 3325 Property(C): AdminUser = 1 Property(C): LogonUser = UK03306 Property(C): UserSID = S-1-5-21-1957994488-1604221776-515967899-4426 Property(C): UserLanguageID = 2057 Property(C): ComputerName = UKCNU1131P6N Property(C): SystemLanguageID = 2057 Property(C): ScreenX = 1280 Property(C): ScreenY = 1024 Property(C): CaptionHeight = 26 Property(C): BorderTop = 1 Property(C): BorderSide = 1 Property(C): TextHeight = 16 Property(C): ColorBits = 32 Property(C): TTCSupport = 1 Property(C): Time = 15:01:43 Property(C): Date = 07/07/2011 Property(C): MsiNetAssemblySupport = 2.0.50727.3053 Property(C): MsiWin32AssemblySupport = 5.1.2600.5512 Property(C): RedirectedDllSupport = 2 Property(C): Privileged = 1 Property(C): USERNAME = Atos Origin Property(C): COMPANYNAME = Atos Origin Property(C): Installed = 00:00:00 Property(C): DATABASE = C:\WINDOWS\Installer\153760c.msi Property(C): OriginalDatabase = D:\Downloads\launcher.msi Property(C): VersionHandler = 3.01 Property(C): ROOTDRIVE = D:\ Property(C): EXECUTEACTION = INSTALL Property(C): ACTION = INSTALL Property(C): UILevel = 5 Property(C): CostingComplete = 0 Property(C): OutOfDiskSpace = 0 Property(C): OutOfNoRbDiskSpace = 0 Property(C): PrimaryVolumeSpaceAvailable = 0 Property(C): PrimaryVolumeSpaceRequired = 0 Property(C): PrimaryVolumeSpaceRemaining = 0 Property(C): INSTALLLEVEL = 1 === Logging stopped: 07/07/2011 15:01:43 === MSI (c) (04:38) [15:01:43:087]: Product: Python Launcher -- Configuration completed successfully.
participants (3)
-
Gertjan Klein -
Paul Moore -
Vinay Sajip