Wix v3 Setting Install Folder according Property given in command line - wix

I would like to change the installation location according to condition.
If property DRIVE was provided in the installation command line, I would like to perform :
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLFOLDERA" Name="My Program Files">
<Directory Id="KUKU" Name="KUKU" >
<Directory Id="INSTALLFOLDER" Name="BuiltInPropertiesExample"/>
</Directory>
</Directory>
</Directory>
If property DRIVE was NOT provided (in the installation command line), I would like to perform :
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="BuiltInPropertiesExample"/>
</Directory>
</Directory>
How do I perform such installation ?

I found solution to my problem:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="BuiltInPropertiesExample" />
</Directory>
</Directory>
<SetDirectory Id="INSTALLFOLDER" Value="[LOCATION]" Sequence="execute" >
<![CDATA[NOT Installed OR LOCATION]]>
</SetDirectory >
when executing
msiexec /i BuiltInPropertiesExample.msi LOCATION=D:\MyProduct\
the tool is installed D:\MyProduct\
When executing
msiexec /i BuiltInPropertiesExample.msi
the tool is installed C:\Program Files\

Related

Ubuntu 14.04 Apache 2.4.7 404 Not Found

I've been reading the forums and trying to replicate their fixes, but I must be missing something on my end since it will switch from a simple 404 Error Not Found to a 403 Forbidden Error (even after chown and chmod changes).
Currently, I am experiencing the 403 error code even after a sudo apache2ctl restart
Here is what I've done so far.
- gedit apache2.conf with the following
<Directory /path/to/directory/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all denied
</Directory>
gedit sites-available/000-default.conf && sites-enabled/000-default.conf
DocumentRoot /path/to/directory
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /path/to/directory>
Options Indexes FollowSymLinks MultiViews
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
Any help is much appreciated.
First note that you have now Apache 2.4, not Apache 2.2. The style to declare permissions has changed with Apache 2.4 and you should consistently use the new ones (like require all granted).
Apache has become more strict in what files it allows to be served. Essentially, arrange the files to be served outside in your Document Root and below, and keep all other files out of this tree. Don't link to files outside the Document Root tree.
Some point of your config:
<Directory />
This is the root directory of your file system. If you declare anything for it, it should be require all denied and nothing else. Note that there is a difference between a <Directory /absolute/path/to/some/directory> directive and a <location /relative/path/to some/location/on/your/server> directive.
Configure your server in terms of <location>

Apache apache2.conf issue

I wantend to access two different version of my site(based on yii2 framework) via slash: http://url.com and http://url.com/something would bring me to another version.
For achieving this i took "something" directory and put it into "url" directory.
It was fine, but not exactly what i wanted, because it seemed like "something" part wasnt loading it's .css and scripts.
I went to apache2.conf file, and modified it -
before:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /home/bahruz/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
after:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /home/bahruz/www/etap/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
After i did this, https://url.com opens site without css and scripts and reverting apache2.conf doesn't help. I tried to restart the apache server, but it does not help.
Please, tell me why this happens and how can i bring everything back?
Thanks in advance.
I could not solve the issue, but restoring previous backup of the www helped. Maybe something happened with .htaccess, because sometimes it becomes invisible or smth.

You don't have permission to access /files/theme/icons on this server

I've recently got an error on my site while trying to get Apaxy to work.
After a while I realized that the icons are not accessible. When I try to open them I get this error message:
Error
You don't have permission to access /files/theme/icons on this server.
This is a part of my apache2.conf (httpd.conf) and everything seems alright in it:
Code
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/html/>
AllowOverride All
Require all granted
</Directory>
I tried everything I found on SO but it didn't work.
I'm not overriding the permissions with any .htaccess file.
I'm running Apache 2.4.7
I solved this problem by changing permissions to read+execute.

Apache 2.4: How to allow access to a whole directory except a subdirectory in it

I tried this in httpd.conf but it doesn't work, I still gives me access to the subfolder "report".
<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "c:/Apache24/htdocs/report">
Require all denied
</Directory>
You need Allow or Deny in the Directory.
<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "c:/Apache24/htdocs/report">
Allow from None
Order allow,deny
</Directory>
More details in the Apache docs: http://httpd.apache.org/docs/current/mod/mod_access_compat.html#allow

Apache: One setting for multiple directories

I'd like to protect multiple directories with mod_digest with one settings.
Currently I have this /etc/apache2/conf.a/mod-digest_realm-protected.conf
AuthType Digest
AuthName "protected"
AuthDigestDomain /adminer/ /school-project/
AuthDigestNonceLifetime 300
AuthDigestProvider file
AuthUserFile /etc/apache2/.digest
Require valid-user
and this in /etc/apache/sites-available/default
<Directory /var/www/adminer/>
Include /etc/apache2/conf.a/mod-digest_realm-protected.conf
</Directory>
<Directory /var/www/school-project/>
Include /etc/apache2/conf.a/mod-digest_realm-protected.conf
</Directory>
Is there a way to have this setting in a single config file? I tried something like this
<Directory /var/www/(adminer/school-project)/>
... auth_digest settings
</Directory>
but it doesn't work.
try this
<Directory /var/www/>
... auth_digest settings
</Directory>
Regex can be used with Directory directive.
http://httpd.apache.org/docs/current/en/mod/core.html#directory
If you just want to protect some of them, I think this should work.
<Directory ~ "(adminer|school-project)"/>
... auth_digest settings
</Directory>
DirectoryMatch also works
<DirectoryMatch ^/var/www/(adminer|school-project)>
...
</DirectoryMatch>