Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions _msbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,28 @@ def mainw_exe(name):
mainw_exe("pythonw"),
main_exe("python3"),
mainw_exe("pythonw3"),

CProject("pyshellext",
VersionInfo(
FileDescription="Python shell extension",
OriginalFilename="pyshellext.dll",
),
Property('DynamicLibcppLinkage', 'true'),
ItemDefinition('ClCompile',
LanguageStandard='stdcpp20',
RuntimeLibrary='MultiThreaded',
),
ItemDefinition('Link',
AdditionalDependencies=Prepend("RuntimeObject.lib;"),
SubSystem='WINDOWS',
ModuleDefinitionFile='$(SourceRootDir)src\\pyshellext\\pyshellext.def',
),
Manifest('default.manifest'),
CSourceFile('shellext.cpp'),
ResourceFile('pyshellext.rc'),
SourceFile('pyshellext.def'),
source='src/pyshellext',
)
)


Expand Down Expand Up @@ -300,6 +322,7 @@ def init_METADATA():
fileversion = _make_xyzw_version(METADATA["Version"], ",")
for vi in PACKAGE.findall("**/VersionInfo"):
vi.from_metadata(METADATA)
vi.options["LegalCopyright"] = "Copyright (c) Python Software Foundation. All Rights Reserved."
vi.options["FILEVERSION"] = fileversion


Expand Down
15 changes: 15 additions & 0 deletions src/pymanager/appxmanifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Package IgnorableNamespaces="desktop4 desktop6 desktop7 uap13 uap17"
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:rescap4="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities/4"
xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
Expand Down Expand Up @@ -193,6 +194,20 @@
</uap:SupportedFileTypes>
</uap:FileTypeAssociation>
</uap:Extension>
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:SurrogateServer AppId="C7E29CB0-9691-4DE8-B72B-6719DDC0B4A1" DisplayName="EditInIdleCommand">
<com:Class Id="C7E29CB0-9691-4DE8-B72B-6719DDC0B4A1" Path="pyshellext.dll" ThreadingModel="Both"/>
</com:SurrogateServer>
</com:ComServer>
</com:Extension>
<desktop4:Extension Category="windows.fileExplorerContextMenus">
<desktop4:FileExplorerContextMenus>
<desktop4:ItemType Type=".py">
<desktop4:Verb Id="EditInIdle" Clsid="C7E29CB0-9691-4DE8-B72B-6719DDC0B4A1" />
</desktop4:ItemType>
</desktop4:FileExplorerContextMenus>
</desktop4:Extension>
</Extensions>
</Application>

Expand Down
4 changes: 0 additions & 4 deletions src/pymanager/default.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
Expand Down
10 changes: 10 additions & 0 deletions src/pymanager/msi.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
<File Source="vcruntime140.dll" />
<File Source="vcruntime140_1.dll" />

<File Source="pyshellext.dll">
<Class Id="{C7E29CB0-9691-4DE8-B72B-6719DDC0B4A1}" Advertise="no"
Context="InprocServer32" ThreadingModel="both" />
</File>

<File Source="version.txt" />
<Environment Id="PATH" Action="set" Name="PATH" Part="last" System="yes" Value="[INSTALLFOLDER]" />

Expand All @@ -56,6 +61,11 @@
<Verb Id="open" TargetFile="python.exe" Argument="&quot;%1&quot; %*" />
</Extension>
</ProgId>
<RegistryValue Root="HKCR" Key="Python.File\shell\EditWithIDLE"
Name="ExplorerCommandHandler"
Value="{C7E29CB0-9691-4DE8-B72B-6719DDC0B4A1}"
Type="string" />

<ProgId Id="Python.NoConFile" Description="Python Script (Windowed)" Advertise="no" Icon="py.ico">
<Extension Id="pyw" ContentType="text/x-python">
<Verb Id="open" TargetFile="pythonw.exe" Argument="&quot;%1&quot; %*" />
Expand Down
20 changes: 20 additions & 0 deletions src/pyshellext/default.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
</assembly>
Binary file added src/pyshellext/idle.ico
Binary file not shown.
Binary file added src/pyshellext/py.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions src/pyshellext/pyshellext.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EXPORTS
DllGetClassObject PRIVATE
DllCanUnloadNow PRIVATE
4 changes: 4 additions & 0 deletions src/pyshellext/pyshellext.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 ICON DISCARDABLE "python.ico"
2 ICON DISCARDABLE "pythonw.ico"
3 ICON DISCARDABLE "py.ico"
4 ICON DISCARDABLE "idle.ico"
Binary file added src/pyshellext/python.ico
Binary file not shown.
Binary file added src/pyshellext/pythonw.ico
Binary file not shown.
Loading