forked from openssh/openssh-portable
-
Notifications
You must be signed in to change notification settings - Fork 346
Initial MSI authoring for Previews #521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | ||
<Fragment> | ||
<!-- KeyPath is necessary for multi-file components to identify the key file - preferrably versioned. --> | ||
<ComponentGroup Id="Client" Directory="INSTALLFOLDER"> | ||
<ComponentGroupRef Id="Shared" /> | ||
<Component> | ||
<File Name="ssh.exe" KeyPath="yes" /> | ||
<File Name="ssh.pdb" /> | ||
</Component> | ||
<Component> | ||
<File Name="sftp.exe" KeyPath="yes" /> | ||
<File Name="sftp.pdb" /> | ||
</Component> | ||
<Component> | ||
<File Name="ssh-add.exe" KeyPath="yes" /> | ||
<File Name="ssh-add.pdb" /> | ||
</Component> | ||
<Component> | ||
<File Name="ssh-keyscan.exe" KeyPath="yes" /> | ||
<File Name="ssh-keyscan.pdb" /> | ||
</Component> | ||
<Component Id="ClientPATH" Guid="F07FFA0C-B5CF-45A3-9013-A7420DDFD654"> | ||
<!-- Use same property condition as PowerShell. We can use a shared component GUID here because there should be only one installed on a system. --> | ||
<Condition>ADD_PATH=1</Condition> | ||
<Environment Id="ClientPATH" Name="PATH" Value="[INSTALLFOLDER]" Action="set" Part="first" System="yes" /> | ||
tgauth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</Component> | ||
</ComponentGroup> | ||
</Fragment> | ||
</Wix> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> | ||
<Platform Condition="'$(Platform)' == ''">x64</Platform> | ||
<ProductVersion>1.1.0</ProductVersion> | ||
<OutputName>openssh</OutputName> | ||
<OutputType>package</OutputType> | ||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath> | ||
<DefineConstants> | ||
$(DefineConstants); | ||
ProductVersion=$(ProductVersion); | ||
</DefineConstants> | ||
<DefineSolutionProperties>false</DefineSolutionProperties> | ||
<WixTargetsPath Condition="'$(WixTargetsPath)' == ''">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'"> | ||
<DefineConstants> | ||
$(DefineConstants); | ||
Debug; | ||
</DefineConstants> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<BindInputPaths Include="..\..\..\bin\$(Platform)\$(Configuration)" /> | ||
tgauth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="product.wxs" /> | ||
<Compile Include="client.wxs" /> | ||
<Compile Include="server.wxs" /> | ||
<Compile Include="shared.wxs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<WixExtension Include="WixFirewallExtension" /> | ||
<WixExtension Include="WixUIExtension" /> | ||
<WixExtension Include="WixUtilExtension" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$(WixTargetsPath)" /> | ||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0"?> | ||
|
||
<?ifndef ProductVersion?> | ||
<?error ProductVersion must be defined?> | ||
<?endif?> | ||
|
||
<!-- Currently support x86, x64 builds. Assumes only previews are built as MSIs. --> | ||
<?if $(var.Platform) = "x64"?> | ||
<?define ProgramFilesFolder = "ProgramFiles64Folder"?> | ||
<?define UpgradeCode = "9E9D0D93-E70D-4424-ADBD-AD3B226A226D"?> | ||
<?elseif $(var.Platform) = "x86"?> | ||
<?define ProgramFilesFolder = "ProgramFilesFolder"?> | ||
<?define UpgradeCode = "2A1799F1-5B26-4DDC-A0C7-03F75C4C08D2"?> | ||
<?else?> | ||
<?error Platform $(var.Platform) is not supported?> | ||
<?endif?> | ||
|
||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | ||
<Product Id="*" Name="OpenSSH" Version="$(var.ProductVersion)" Language="1033" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.UpgradeCode)"> | ||
<Package Compressed="yes" InstallerVersion="200" InstallScope="perMachine"/> | ||
<MediaTemplate EmbedCab="yes" /> | ||
|
||
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A newer version of !(bind.property.ProductName) is already installed." /> | ||
<Condition Message="OpenSSH is supported only on Windows 7 and newer."><![CDATA[VersionNT >= 601]]></Condition> | ||
|
||
<Feature Id="Client" AllowAdvertise="no"> | ||
<ComponentGroupRef Id="Client" /> | ||
</Feature> | ||
<Feature Id="Server" AllowAdvertise="no"> | ||
<ComponentGroupRef Id="Server" /> | ||
</Feature> | ||
|
||
<Directory Id="TARGETDIR" Name="SourceDir"> | ||
<Directory Id="$(var.ProgramFilesFolder)" Name="Program Files"> | ||
<Directory Id="INSTALLFOLDER" Name="OpenSSH" /> | ||
</Directory> | ||
</Directory> | ||
</Product> | ||
</Wix> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:firewall="http://schemas.microsoft.com/wix/FirewallExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> | ||
<Fragment> | ||
<!-- KeyPath is necessary for multi-file components to identify the key file - preferrably versioned. --> | ||
<ComponentGroup Id="Server" Directory="INSTALLFOLDER"> | ||
<ComponentGroupRef Id="Shared" /> | ||
<Component> | ||
<File Name="sftp-server.exe" KeyPath="yes" /> | ||
<File Name="sftp-server.pdb" /> | ||
</Component> | ||
<Component> | ||
<File Name="ssh-shellhost.exe" KeyPath="yes" /> | ||
<File Name="ssh-shellhost.pdb" /> | ||
</Component> | ||
<Component> | ||
<File Id="sshd.exe" Name="sshd.exe" KeyPath="yes" /> | ||
<File Name="sshd.pdb" /> | ||
<RegistryKey Root="HKLM" Key="SOFTWARE\OpenSSH" ForceCreateOnInstall="yes"> | ||
heaths marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<PermissionEx Sddl="O:BAG:SYD:P(A;OICI;KR;;;AU)(A;OICI;KA;;;SY)(A;OICI;KA;;;BA)" /> | ||
<!-- ssh-agent-associated key should only be created if the Server feature is installed. --> | ||
<RegistryKey Key="agent" ForceCreateOnInstall="yes"> | ||
<PermissionEx Sddl="O:BAG:SYD:P(A;OICI;KA;;;SY)(A;OICI;KA;;;BA)" /> | ||
</RegistryKey> | ||
</RegistryKey> | ||
<ServiceInstall | ||
Name="sshd" | ||
DisplayName="OpenSSH SSH Server" | ||
Description="OpenSSH is a connectivity tool for remote login that uses the SSH protocol. It encrypts all traffic between client and server to eliminate eavesdropping, connection hijacking, and other attacks." | ||
Start="auto" | ||
Type="ownProcess" | ||
Interactive="no" | ||
ErrorControl="critical" | ||
Vital="yes"> | ||
<util:ServiceConfig | ||
ResetPeriodInDays="1" | ||
FirstFailureActionType="restart" | ||
SecondFailureActionType="restart" | ||
ThirdFailureActionType="restart" | ||
/> | ||
</ServiceInstall> | ||
<ServiceControl | ||
Id="ControlSshd" | ||
Name="sshd" | ||
Start="install" | ||
Stop="both" | ||
Remove="uninstall" /> | ||
<firewall:FirewallException | ||
Id="sshd_allow" | ||
Name="OpenSSH SSH Server Preview (sshd)" | ||
Description="Inbound rule for OpenSSH SSH Server (sshd)" | ||
Program="[#sshd.exe]" | ||
Protocol="tcp" | ||
Port="22" | ||
Scope="any" | ||
/> | ||
</Component> | ||
<Component> | ||
<File Name="sshd_config_default"> | ||
<PermissionEx Sddl="O:BAG:SYD:PAI(A;;FA;;;SY)(A;;FA;;;BA)" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can have read permissions to the authorized users. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was copied from the scripts at the time of writing. Have they changed? |
||
</File> | ||
</Component> | ||
</ComponentGroup> | ||
|
||
<!-- Automatically add custom actions if referencing the Server component group. --> | ||
<SetProperty Id="SetPrivilegesOnSshd" Value=""[SystemFolder]sc.exe" privs sshd SeAssignPrimaryTokenPrivilege/SeTcbPrivilege/SeBackupPrivilege/SeRestorePrivilege/SeImpersonatePrivilege" Sequence="execute" Before="SetPrivilegesOnSshd" /> | ||
<CustomAction Id="SetPrivilegesOnSshd" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" /> | ||
<InstallExecuteSequence> | ||
<Custom Action="SetPrivilegesOnSshd" After="InstallServices"><![CDATA[&Server = 3]]></Custom> | ||
</InstallExecuteSequence> | ||
</Fragment> | ||
</Wix> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> | ||
<Fragment> | ||
<!-- KeyPath is necessary for multi-file components to identify the key file - preferrably versioned. --> | ||
<ComponentGroup Id="Shared" Directory="INSTALLFOLDER"> | ||
<Component> | ||
<File Name="libcrypto.dll" KeyPath="yes" /> | ||
<File Name="libcrypto.pdb" /> | ||
</Component> | ||
<Component> | ||
<File Name="moduli"> | ||
<PermissionEx Sddl="D:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;WD)" /> | ||
</File> | ||
</Component> | ||
<Component> | ||
<File Name="scp.exe" KeyPath="yes" /> | ||
<File Name="scp.pdb" /> | ||
</Component> | ||
<Component> | ||
<File Name="ssh-keygen.exe" KeyPath="yes" /> | ||
<File Name="ssh-keygen.pdb" /> | ||
</Component> | ||
|
||
<!-- ssh-agent is useful in both client and server scenarios. --> | ||
<Component> | ||
<File Name="openssh-events.man"> | ||
<util:EventManifest ResourceFile="[#ssh_agent.exe]" /> | ||
</File> | ||
</Component> | ||
<Component> | ||
<!-- Define the File/@Id to reference in util:EventManifest/@ResourceFile above. --> | ||
<File Id="ssh_agent.exe" Name="ssh-agent.exe" KeyPath="yes" /> | ||
<File Name="ssh-agent.pdb" /> | ||
<ServiceInstall | ||
Name="ssh-agent" | ||
DisplayName="OpenSSH Authentication Agent" | ||
Description="Agent to hold private keys used for public key authentication." | ||
Start="auto" | ||
Type="ownProcess" | ||
Interactive="no" | ||
ErrorControl="critical" | ||
Vital="yes"> | ||
<util:ServiceConfig | ||
ResetPeriodInDays="1" | ||
FirstFailureActionType="restart" | ||
SecondFailureActionType="restart" | ||
ThirdFailureActionType="restart" | ||
/> | ||
<PermissionEx Sddl="D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;RP;;;AU)" /> | ||
</ServiceInstall> | ||
<ServiceControl | ||
Id="ControlSshAgent" | ||
Name="ssh-agent" | ||
Start="install" | ||
Stop="both" | ||
Remove="uninstall" /> | ||
</Component> | ||
</ComponentGroup> | ||
|
||
<!-- Automatically add custom actions if referencing the Shared component group. --> | ||
<SetProperty Id="SetPrivilegesOnSshAgent" Value=""[SystemFolder]sc.exe" privs ssh-agent SeImpersonatePrivilege" Sequence="execute" Before="SetPrivilegesOnSshAgent" /> | ||
<CustomAction Id="SetPrivilegesOnSshAgent" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" /> | ||
<InstallExecuteSequence> | ||
<Custom Action="SetPrivilegesOnSshAgent" After="InstallServices"><![CDATA[&Server = 3]]></Custom> | ||
</InstallExecuteSequence> | ||
</Fragment> | ||
</Wix> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.