<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- see Product.wxs.comments.txt for more comments -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" >
  <Product Id="*" UpgradeCode="{FC6FB3A2-65DE-41A9-AD91-D10A402BD641}" Language="1033" Version="$(var.InternalVersion)" 
    Name="Salt Minion $(var.DisplayVersion)" Manufacturer="SaltStack, Inc">

    <!-- Package must be the first element after Product and seems very related -->
    <Package  InstallerVersion="200" Compressed="yes" InstallScope="perMachine"  Keywords="infrastructure management" />

    <!-- set default values -->
    <Property Id="MASTER_HOSTNAME"          Value="salt"                 />
    <Property Id="MINION_HOSTNAME"          Value="$(env.COMPUTERNAME)"  />
    <Property Id="ARPURLINFOABOUT"          Value="http://saltstack.org" />
    <Property Id="KEEP_CONFIG"              Value="0"                    />
    <Property Id="ROOTDRIVE"                Value="$(env.SystemDrive)"   />   <!-- // do not chose the disk with most free space -->
    <Property Id="ARPPRODUCTICON"           Value="icon"                 />
    <Property Id="WIXUI_INSTALLDIR"         Value="INSTALLFOLDER"        />
    <Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable"              />

    <InstallUISequence>
      <!-- 2016-11-13  mkr
		      To remove a previous NSIS installation but utilise its configuration (peelNSIS), this custom action must start 'early'.
		      Catch: If the installation then fails and rolls back, peeling cannot be undone.
	    -->
      <Custom Action='PrepareEvironmentBeforeInstallation' Before='AppSearch'>NOT Installed</Custom>
    </InstallUISequence>

    <InstallExecuteSequence>
      <Custom Action='PrepareEvironmentBeforeInstallation' Before='AppSearch'>NOT Installed</Custom>

      <!-- 2016-11-13  mkr  Both C# and WiX custom actions are forced into an execution order by the Before attribute. -->
      <Custom Action='SetRootDirPropertiesCA' Before='SetRootDir'>NOT Installed</Custom>
      <Custom Action='SetRootDir' Before='SetMasterPropertiesCA'>NOT Installed</Custom>

      <Custom Action='SetMasterPropertiesCA' Before='SetMaster'>NOT Installed</Custom>
      <Custom Action='SetMaster' Before='SetMinionIdPropertiesCA'>NOT Installed</Custom>

      <Custom Action='SetMinionIdPropertiesCA' Before='SetMinionId'>NOT Installed</Custom>
      <Custom Action='SetMinionId' Before='StartServices'>NOT Installed</Custom>

      <StartServices Sequence="5900">
        <![CDATA[START_MINION_SERVICE = "1"]]>
      </StartServices>

      <Custom Action='CS_CUSTOM_ACTION_NUKE_CONF'  After='InstallFinalize'>(REMOVE ~= "ALL") AND (KEEP_CONFIG = "0")</Custom>
    </InstallExecuteSequence>

    

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

    <!-- Delete a folder recursivly -->
    <!-- incomplete tutorial: https://www.hass.de/content/wix-how-use-removefolderex-your-xml-scripts -->    
    <!-- SRP: Simple Remember Pattern http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/  -->
    <!-- SRP: to remove a folder on uninstall, RemoveFolderEx must read a *FOLDER property from registry. -->
    <!--The SRP pattern will be repeated now -->
    <!--Components CANNOT BECAUSE WRONG TIME depend on Property KEEP_CONFIG-->
    <!-- SRP: write exactly what to registry? During uninstall, I must assume? -->
    <DirectoryRef Id="BINFOLDER">
      <Component Id="CleanupBinFolder" Guid="*">
        <RegistryValue Root="HKLM" Key="SOFTWARE\Saltstack\Salt Minion" Name="BinPath" Type="string" Value="[BINFOLDER]" KeyPath="yes" /> <util:RemoveFolderEx On="uninstall" Property="BINFOLDER" />
      </Component>
    </DirectoryRef>
    <!-- SRP: read from registry. I have no clue why this removes a folder  -->
    <Property Id="BINFOLDER">
      <RegistrySearch  Root="HKLM" Key="SOFTWARE\Saltstack\Salt Minion" Name="BinPath" Type="raw"  Id="BINFOLDER_REGSEARCH" />
    </Property>
    <!-- SRP: write to registry. -->
    <DirectoryRef Id="VARFOLDER">
      <Component Id="CleanupVarFolder" Guid="*">
        <RegistryValue Root="HKLM" Key="SOFTWARE\Saltstack\Salt Minion" Name="VarPath" Type="string" Value="[VARFOLDER]" KeyPath="yes" /> <util:RemoveFolderEx On="uninstall" Property="VARFOLDER" />
      </Component>
    </DirectoryRef>
    <!-- SRP: read from registry. -->
    <Property Id="VARFOLDER">
      <RegistrySearch  Root="HKLM" Key="SOFTWARE\Saltstack\Salt Minion" Name="VarPath" Type="raw"  Id="VARFOLDER_REGSEARCH" />
    </Property>




    <Feature Id="ProductFeature" Title="Minion" Level="1">
      <!-- include from above and below. Why (so complicated) ?  -->
      <ComponentGroupRef Id="ProductComponents"     />
      <ComponentRef      Id="CleanupBinFolder"      />
      <ComponentRef      Id="CleanupVarFolder"      />
    </Feature>

    <Icon Id="icon" SourceFile="$(var.dist)\salt.ico" />
    <WixVariable Id="WixUILicenseRtf" Value="LICENSE.rtf" />

    <!-- override the banners -->
    <WixVariable Id="WixUIBannerBmp" Value="Banner.jpg" />
    <WixVariable Id="WixUIDialogBmp" Value="Dialog.jpg" />

    <UIRef Id="WixUI_Minion" />                             <!-- // include from file WixUI_Minion.wxs in this directory -->
    
    <MediaTemplate EmbedCab="yes" CompressionLevel="low" /> <!-- // do not create cab files -->
    
  </Product>

  <!-- Declare bin and var folder for RemoveFolderEX remember pattern -->
  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="INSTALLFOLDER" Name="salt" >
        <Directory Id="BINFOLDER" Name="bin" />
        <Directory Id="CONFFOLDER" Name="conf" />
        <Directory Id="VARFOLDER" Name="var" />
      </Directory>
    </Directory>
  </Fragment>
  
  <!-- From the "Default WiX Project Template" -->
  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <ComponentGroupRef Id="dist"    />       <!-- // include from file dist-amd64.wxs in this directory -->
      <ComponentGroupRef Id="service" />       <!-- // include from file service.wxs    in this directory -->
    </ComponentGroup>
  </Fragment>
</Wix>
<commit_msg>documentation<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- see Product.wxs.comments.txt for more comments -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" >
  <Product Id="*" UpgradeCode="{FC6FB3A2-65DE-41A9-AD91-D10A402BD641}" Language="1033" Version="$(var.InternalVersion)" 
    Name="Salt Minion $(var.DisplayVersion)" Manufacturer="SaltStack, Inc">

    <!-- Package must be the first element after Product and seems very related -->
    <Package  InstallerVersion="200" Compressed="yes" InstallScope="perMachine"  Keywords="infrastructure management" />

    <!-- set default values -->
    <Property Id="MASTER_HOSTNAME"          Value="salt"                 />
    <Property Id="MINION_HOSTNAME"          Value="$(env.COMPUTERNAME)"  />
    <Property Id="ARPURLINFOABOUT"          Value="http://saltstack.org" />
    <Property Id="KEEP_CONFIG"              Value="0"                    />
    <Property Id="ROOTDRIVE"                Value="$(env.SystemDrive)"   />   <!-- // do not chose the disk with most free space -->
    <Property Id="ARPPRODUCTICON"           Value="icon"                 />
    <Property Id="WIXUI_INSTALLDIR"         Value="INSTALLFOLDER"        />
    <Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable"              />

    <InstallUISequence>
      <!-- 2016-11-13  mkr
		      To remove a previous NSIS installation but utilise its configuration (peelNSIS), this custom action must start 'early'.
		      Catch: If the installation then fails and rolls back, peeling cannot be undone.
	    -->
      <Custom Action='PrepareEvironmentBeforeInstallation' Before='AppSearch'>NOT Installed</Custom>
    </InstallUISequence>

    <InstallExecuteSequence>
      <Custom Action='PrepareEvironmentBeforeInstallation' Before='AppSearch'>NOT Installed</Custom>

      <!-- 2016-11-13  mkr  Both C# and WiX custom actions are forced into an execution order by the Before attribute. -->
      <Custom Action='SetRootDirPropertiesCA' Before='SetRootDir'>NOT Installed</Custom>
      <Custom Action='SetRootDir' Before='SetMasterPropertiesCA'>NOT Installed</Custom>

      <Custom Action='SetMasterPropertiesCA' Before='SetMaster'>NOT Installed</Custom>
      <Custom Action='SetMaster' Before='SetMinionIdPropertiesCA'>NOT Installed</Custom>

      <Custom Action='SetMinionIdPropertiesCA' Before='SetMinionId'>NOT Installed</Custom>
      <Custom Action='SetMinionId' Before='StartServices'>NOT Installed</Custom>

      <StartServices Sequence="5900">
        <![CDATA[START_MINION_SERVICE = "1"]]>
      </StartServices>

      <Custom Action='CS_CUSTOM_ACTION_NUKE_CONF'  After='InstallFinalize'>(REMOVE ~= "ALL") AND (KEEP_CONFIG = "0")</Custom>
    </InstallExecuteSequence>

    

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

    <!-- Delete a folder recursivly -->
    <!-- incomplete tutorial: https://www.hass.de/content/wix-how-use-removefolderex-your-xml-scripts -->    
    <!-- SRP: Simple Remember Pattern http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/  -->
    <!-- SRP: to remove a folder on uninstall, RemoveFolderEx must read a *FOLDER property from registry. -->
    <!--The SRP pattern will be repeated now -->
    <!--Components CANNOT BECAUSE WRONG TIME depend on Property KEEP_CONFIG-->
    <!-- SRP: write exactly what to registry? During uninstall, I must assume? -->
    <DirectoryRef Id="BINFOLDER">
      <Component Id="CleanupBinFolder" Guid="*">
        <RegistryValue Root="HKLM" Key="SOFTWARE\Saltstack\Salt Minion" Name="BinPath" Type="string" Value="[BINFOLDER]" KeyPath="yes" /> <util:RemoveFolderEx On="uninstall" Property="BINFOLDER" />
      </Component>
    </DirectoryRef>
    <!-- SRP: read from registry. I have no clue why this removes a folder  -->
    <Property Id="BINFOLDER">
      <RegistrySearch  Root="HKLM" Key="SOFTWARE\Saltstack\Salt Minion" Name="BinPath" Type="raw"  Id="BINFOLDER_REGSEARCH" />
    </Property>
    <!-- SRP: write to registry. -->
    <DirectoryRef Id="VARFOLDER">
      <Component Id="CleanupVarFolder" Guid="*">
        <RegistryValue Root="HKLM" Key="SOFTWARE\Saltstack\Salt Minion" Name="VarPath" Type="string" Value="[VARFOLDER]" KeyPath="yes" /> <util:RemoveFolderEx On="uninstall" Property="VARFOLDER" />
      </Component>
    </DirectoryRef>
    <!-- SRP: read from registry. -->
    <Property Id="VARFOLDER">
      <RegistrySearch  Root="HKLM" Key="SOFTWARE\Saltstack\Salt Minion" Name="VarPath" Type="raw"  Id="VARFOLDER_REGSEARCH" />
    </Property>




    <Feature Id="ProductFeature" Title="Minion" Level="1">
      <!-- include from above and below. Why (so complicated) ?  -->
      <ComponentGroupRef Id="ProductComponents"     />
      <ComponentRef      Id="CleanupBinFolder"      />
      <ComponentRef      Id="CleanupVarFolder"      />
    </Feature>

    <Icon Id="icon" SourceFile="$(var.dist)\salt.ico" />
    <WixVariable Id="WixUILicenseRtf" Value="LICENSE.rtf" />

    <!-- override the banners -->
    <WixVariable Id="WixUIBannerBmp" Value="Banner.jpg" />
    <WixVariable Id="WixUIDialogBmp" Value="Dialog.jpg" />

    <UIRef Id="WixUI_Minion" />                             <!-- // include WixUI_Minion.wxs in this directory -->
    
    <MediaTemplate EmbedCab="yes" CompressionLevel="low" /> <!-- // do not create cab files -->
    
  </Product>

  <!-- Declare bin and var folder for RemoveFolderEX remember pattern -->
  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="INSTALLFOLDER" Name="salt" >
        <Directory Id="BINFOLDER" Name="bin" />
        <Directory Id="CONFFOLDER" Name="conf" />
        <Directory Id="VARFOLDER" Name="var" />
      </Directory>
    </Directory>
  </Fragment>
  
  <!-- From the "Default WiX Project Template" -->
  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <ComponentGroupRef Id="dist"    />       <!-- // include dist-amd64.wxs in this directory -->
      <ComponentGroupRef Id="service" />       <!-- // include service.wxs    in this directory -->
    </ComponentGroup>
  </Fragment>
</Wix>

{'fraction_non_alphanumeric': 0.1471861471861472, 'fraction_numerical': 0.010261343594676928, 'mean_word_length': 3.241754505270316, 'pattern_counts': {'":': 0, '<': 219, '<?xml version=': 2, '>': 219, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1043767', 'n_tokens_mistral': 3854, 'n_tokens_neox': 3634, 'n_words': 846}