Skip to content

Commit

Permalink
Refactor git-credential-manager.exe handling to clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
robmen committed Jun 14, 2018
1 parent 92f934a commit 49583db
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
24 changes: 24 additions & 0 deletions src/Package/GitComponents.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,28 @@
</Component>
</ComponentGroup>
</Fragment>

<Fragment>
<ComponentGroup Id='GitCredentialManager' Directory='GitCoreFolder'>
<Component>
<fg:HarvestFile Source='..\..\files\mingw32\libexec\git-core\git-credential-manager.exe'
KeyIdentifier='CredManagerFile' />
</Component>
</ComponentGroup>

<CustomActionRef Id='InstallGitCredentialManager' />
</Fragment>

<Fragment>
<SetProperty Id='InstallGitCredentialManager' Value='"[#CredManagerFile]" config --global credential.helper manager'
Before='InstallGitCredentialManager' Sequence='execute' />
<CustomAction Id='InstallGitCredentialManager' BinaryKey='WixCA' DllEntry='WixQuietExec'
Execute='deferred' Return='ignore' Impersonate='yes'/>

<PropertyRef Id="WIX_IS_NETFRAMEWORK_451_OR_LATER_INSTALLED" />

<InstallExecuteSequence>
<Custom Action='InstallGitCredentialManager' Before='InstallFinalize'>NOT Installed AND WIX_IS_NETFRAMEWORK_451_OR_LATER_INSTALLED</Custom>
</InstallExecuteSequence>
</Fragment>
</Wix>
14 changes: 0 additions & 14 deletions src/Package/GitCredStoreComponents.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</ComponentGroup>

<CustomActionRef Id='InstallGitCredentials' />
<CustomActionRef Id='InstallGitCredentialManager' />
</Fragment>

<Fragment>
Expand All @@ -32,17 +31,4 @@
<Custom Action='InstallGitCredentials' Before='InstallFinalize'>NOT Installed AND NOT WIX_IS_NETFRAMEWORK_451_OR_LATER_INSTALLED</Custom>
</InstallExecuteSequence>
</Fragment>

<Fragment>
<SetProperty Id='InstallGitCredentialManager' Value='"[#fil65820BAC8645ECCA80F578593ABCC673]" config --system credential.helper manager'
Before='InstallGitCredentialManager' Sequence='execute' />
<CustomAction Id='InstallGitCredentialManager' BinaryKey='WixCA' DllEntry='WixQuietExec'
Execute='deferred' Return='ignore' Impersonate='yes'/>

<PropertyRef Id="WIX_IS_NETFRAMEWORK_451_OR_LATER_INSTALLED" />

<InstallExecuteSequence>
<Custom Action='InstallGitCredentialManager' Before='InstallFinalize'>NOT Installed AND WIX_IS_NETFRAMEWORK_451_OR_LATER_INSTALLED</Custom>
</InstallExecuteSequence>
</Fragment>
</Wix>
9 changes: 8 additions & 1 deletion src/Package/GitProduct.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
</Component>

<ComponentGroupRef Id='GitComponents'/>
<ComponentGroupRef Id='GitCredentialManager'/>
<ComponentGroupRef Id='GitCredStoreComponents'/>
<ComponentGroupRef Id='GitPoshComponents'/>
</Feature>
Expand All @@ -28,7 +29,13 @@
<Fragment>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='INSTALLFOLDER' Name='Git' />
<Directory Id='INSTALLFOLDER' Name='Git'>
<Directory Id='Mingw32Folder' Name='mingw32'>
<Directory Id='LibexecFolder' Name='libexec'>
<Directory Id='GitCoreFolder' Name='git-core' />
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
Expand Down

0 comments on commit 49583db

Please sign in to comment.