#Apache: avoid using .htaccess files completely

.htaccess files are read on every request.

You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.



Do not log requests for images in the access log

The following lines should be included in httpd.conf to keep requests for images from appearing in the access log. It can be easily modified to prevent logging of particular directories, or to prevent logging of requests coming from particular hosts.

SetEnvIf Request_URI \.gif image-request
SetEnvIf Request_URI \.jpg image-request
SetEnvIf Request_URI \.png image-request
CustomLog logs/access_log env=!image-request

Как получить значение свойства в Deferred Custom Action

English: How to Transfer Properties to Deferred Custom Action
Мы можем найти следующую информацию в MSDN. Где в последнем абзаце находим простое решение. Если его перевести на Wix-код, получим следующее (синим цветом выделено решение):

—–begin of test.wxs

<?xml version='1.0'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' >
 <Product Id='{00A86C83-0000-0000-0000-2FDF0595B100}'
  Name='Property to deffered custom action'
  Version='' Manufacturer='Vlasenko'
  <Package Description="Property to a deffered custom action"
  <Media Id="1"
   EmbedCab="yes" />
  <Directory Id="TARGETDIR" Name="SourceDir">
   <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLDIR" Name="Property to deffered custom action">
     <Component Id="first" Guid="*">
      <File Id="test" DiskId="1"
       Name="test.wxs" Source="test.wxs" KeyPath="yes" />
  <Feature Id='Main' Title='Property to deffered custom action' Level='1'>
   <ComponentRef Id="first" />
  <CustomAction Id="ShowInstallDir.SetProperty"
   Property="ShowInstallDir" Value="[INSTALLDIR]" />
  <CustomAction Id="ShowInstallDir"
   Script="vbscript" Execute="deferred">
   Dim property
   property = Session.Property("CustomActionData")
   MsgBox property
   <Custom Action="ShowInstallDir.SetProperty"
    Before="InstallInitialize">NOT REMOVE="ALL"</Custom>
   <Custom Action="ShowInstallDir"
    Before="InstallFinalize">NOT REMOVE="ALL"</Custom>

end of test.wxs—–

To get msi-file:

  1. Download and install Wix.
  2. Save code to test.wxs
  3. Execute command candle test .wxs
  4. Execute command light -out test.msi test.wixobj

В следующий раз выложу код с реальным использованием этого решения (установка Apache httpd сервиса и генерация конфигурационного файла httpd.conf во-время инсталяции).