Skip to content
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

GPII-3714: First implementation of the "secret blower" #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output
secret.txt
81 changes: 81 additions & 0 deletions MorphicCredentials.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<?define ProductName = "Morphic Credentials" ?>
<?define ProductManufacturer = "Raising the Floor" ?>
<?define ProductVersion = "$(fun.AutoVersion(1.0))" ?>
<?define UpgradeCode = "ba83073a-cfbf-453f-8547-01785f83162c" ?>

<Product Id="*"
Name="$(var.ProductName)"
Manufacturer="$(var.ProductManufacturer)"
Version="$(var.ProductVersion)"
UpgradeCode="$(var.UpgradeCode)"
Language="1033"
>
<Package InstallerVersion="100"
Compressed="yes"
InstallScope="perMachine"
/>
<MediaTemplate EmbedCab="yes" />

<!-- WixQueryOsWellKnownSID properties, see:
http://wixtoolset.org/documentation/manual/v3/customactions/osinfo.html
-->
<PropertyRef Id="WIX_ACCOUNT_USERS" />
<PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS" />

<!-- Features -->
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="MorphicCredentials"/>
</Feature>

<!-- Components -->
<DirectoryRef Id="MorphicCredentialsProgramDataFolder" />

<!-- Minimal user interface -->
<UI Id="UserInterface">
<Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />
<Property Id="WixUI_Mode" Value="Custom" />

<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />

<DialogRef Id="ProgressDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="FatalError" />
<DialogRef Id="UserExit" />

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="EndDialog" Value="Return" Order="2"></Publish>

<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>

<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
</UI>
<UIRef Id="WixUI_Common" />

<!-- Folder structure -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="CommonAppDataFolder" Name="ProgramData">
<Directory Id="MorphicCredentialsProgramDataFolder" Name="$(var.ProductName)">
<Component Id="MorphicCredentials" Guid="03936c9a-3365-4189-a5d6-7eee7b932f4a">
<File Id="MorphicCredentialsFile" Source="secret.txt">
<!-- Only administrators have read access -->
<Permission GenericAll="no" User="[WIX_ACCOUNT_USERS]" />
<Permission GenericRead="yes" Read="yes" User="[WIX_ACCOUNT_ADMINISTRATORS]" />
</File>
</Component>
</Directory>
</Directory>
</Directory>

</Product>
</Wix>
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# morphic-credentials-installer
# Morphic Credentials

Morphic Credentials is a tiny Windows Installer (MSI) that installs the Morphic client credentials into a secure area of the filesystem.

## Usage

The secret needs to be generated manually and copied into a file called secret.txt.

Run build.ps1

Remember, DO NOT commit the secret.txt file. :)
24 changes: 24 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<#
This script creates the installer with the client credentials for Morphic.
#>

if (!(Test-Path -Path secret.txt)) {
Write-Output ""
Write-Output "Please provide the secret.txt file."
Write-Output ""
exit 1
}

function Clean {
rm *.wixobj, output\*.wixpdb
}

Clean

Remove-Item -Recurse output
mkdir output

candle -out MorphicCredentials.wixobj MorphicCredentials.wxs
light -ext WiXUtilExtension -ext WixUIExtension MorphicCredentials.wixobj -sacl -o output/MorphicCredentials.msi

Clean