WIX Changing default installation path - asp.net

I am creating .msi file for a web application using WIX toolset. I am able to create the file and installing too. But this is getting installed in my C: Drive. Is there any option/property so that i can install my application in my customized location. Below is my Product.wsx file code.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include "SourceFilesPath.wxi"?>
<Product Id="{2A8ED50E-1A72-4C1C-A0B6-8CE057414C7B}" Name="TestSetUpProject" Language="1033" Version="1.0.0.0"
Manufacturer="Rahul Test" UpgradeCode="fac49d06-fde2-4483-b244-025d65d0ed6b">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
Platform="x86" Description="Test" Comments="Test" InstallPrivileges="elevated" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."
Schedule="afterInstallInitialize" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Feature Id="ProductFeature" Title="TestSetUpProject" Level="1">
<ComponentGroupRef Id="ComponentsGroup" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="TestSetUpProject" />
</Directory>
</Directory>
</Fragment>
<!--<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
</ComponentGroup>
</Fragment>-->
</Wix>
I tried using all the system properties from this link :
msdn.microsoft.com

Try to give Name to the ProgramFilesFolder:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="XXXX">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="TestSetUpProject" />
</Directory>
</Directory>

For your purposes you need to add Property tag with your custom path value. And then add a Directory tag with the same Id as created Property has.
You could use following code:
<Property Id="CUSTOMPATH" Value="YOUR_CUSTOM_FULL_PATH"></Property>
<Directory Id="TARGETDIR" Name="SourceDir">
...
<Directory Id ="CUSTOMPATH">
...
</Directory>
...
</Directory>

Related

How to use PHPUnit code-coverage-tool PCOV in PhpStorm

I use PHP 7.4.13, PhpStorm 2020.1.4, PHPUnit 9.5.8.
I try to use PHPUnit code coverage tool with PCOV, but I don't get it to work.
I installed pcov:
pecl install pcov
I enabled the extension in the php.ini file:
extension="pcov.so"
My phpunit.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Integration">
<directory suffix="Test.php">./tests/Integration</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="MAIL_DRIVER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="DB_DATABASE" value="testing"/>
</php>
</phpunit>
When I try to run phpunit --coverage-html coverage I get the following:
I think the problem is the missing coverage driver. But where does the problem come from and how can I fix it?
I'm trying to solve this problem since 3 hours now, but I cant find a way.
I hope someone can help :)

Hosting ASP.NET files for local network

I am trying to set up a site that needs to be accessed by users on my local network only with IIS Express (latest version), I am able to access it through the URL http://timesheet:8080, however, none of the other networked machines are able to access it through this URL.
The <sites> section in the applicationhost.config files reads as follows:
<sites>
<site name="Final Time Planning" id="1">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="T:\Public$\Temp\Charlie\Web\Final Time Planning" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:8080:timesheet" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
I have also added 'timesheet' in my hosts file with the local ip of 127.0.0.1.
What am I doing wrong? Any suggestions greatly appreciated. If you need any more info feel free to ask.
You say:
I have also added 'timesheet' in my hosts file with the local ip of 127.0.0.1.
Have you added a line to the hosts files of all the computers attempting to access your site, pointing to your PCs IP address?
Also, you may need to enable remote requests
EDIT
Given your lack of access to hosts files/DNS configuration, I think your best bet would be to configure IIS Express to listen on any host name. Then, someone can access it either as http://yourmachinename:8080/ or http://timesheets:8080/ depending on if they can resolve timesheets.
Change your bindingInformation attribute to
bindingInformation="*:8080:"

Ant: Setup phpunit.xml

In my application, I have the phpunit tests next to the source code. So in all maps next to let's say DoSometing.class.php I have a DoSomethingTest.class.php.
I want to configure phpunit.xml to test all these *Test.class.php files.
How do I do that in phpunit.xml?
I have something like this at the moment:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="true"
stopOnFailure="true"
syntaxCheck="false">
<testsuites>
<testsuite name="My Test Suite">
<directory>./*Test.class.php</directory>
</testsuite>
</testsuites>
<groups />
<filter />
<logging />
<listeners />
</phpunit>
We use a similar structure, only our test files end with the extension .TEST, or .QTEST, .JTEST based on the testing framework since we have JavaScript and other embedded code as well that needs testing. As such, we use the suffix option on the directory node as shown below.
<phpunit>
<testsuites>
<testsuite name="Your Test Suite Name">
<directory suffix=".test">.</directory>
</testsuite>
</testsuites>
</phpunit>
For the PHP Unit tests (*.TEST) we use the following PHPUNIT.xml (this is edited for size)
<!-- PHPUnit Core Settings -->
<phpunit backupStaticAttributes="false"
bootstrap="PeriScope-Bootstrap.php"
...
<testsuites>
<testsuite name="ICAP User Interface Library">
<directory suffix=".test">lib/.</directory>
</testsuite>
<testsuite name="Enterprise Scale Manager">
<directory suffix=".test">ESM/.</directory>
</testsuite>
...
</testsuites>
<!-- Add files not covered with tests into Code Coverage Analysis -->
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".class">lib/.</directory>
<directory suffix=".fn">lib/.</directory>
<directory suffix=".php">lib/.</directory>
...
<exclude>
<directory>ExternalLibraries</directory>
</exclude>
</whitelist>
</filter>
<logging>
...
</logging>
</phpunit>

ASP.NET virtual directory _within_ VS2008

I'm building an ASP.NET 3.5 web application. When I run the project (using Visual Studio's built-in server), it needs to be able to access a network share as a virtual directory. I can't seem to find any information about how to do this.
The network resource is very large, is updated frequently, and is used by other developers and in other projects projects--not just me and mine.
I understand that I can create an IIS virtual directory to the network path once the site is deployed, but that doesn't help me while I'm debugging.
You can't do this with the web development server. It's for debugging a single application, not one that depends on multiple virtual directories.
How does it reference the virtual directory mapped to the share? By redirecting to resources under that virtual directory? If so, then during debugging, could you just change the location it redirects to to be an IIS virtual directory?
It's now possible to have both virtual directories and sub-applications with newer versions of Visual Studio and IIS Express.
Open .vs\All\config\applicationhost.config in your text editor of choice, then navigate to the configuration/system.applicationHost/sites node.
Update the site element that corresponds to your parent application, like so:
Original:
<site name="Web" id="1">
<!-- parent application -->
<application path="/" applicationPool="Clr4IntegratedAppPool">
<!-- application root -->
<virtualDirectory path="/" physicalPath="C:\Src\Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:5706:localhost" />
<binding protocol="https" bindingInformation="*:44300:localhost" />
</bindings>
</site>
Modified:
<site name="Web" id="1">
<!-- parent application -->
<application path="/" applicationPool="Clr4IntegratedAppPool">
<!-- application root -->
<virtualDirectory path="/" physicalPath="C:\Src\Web" />
<!-- virtual directory -->
<virtualDirectory path="/DocRoot" physicalPath="C:\Src\DocRoot" />
</application>
<!-- sub-application -->
<application path="/FooBar" applicationPool="Clr4IntegratedAppPool">
<!-- application root -->
<virtualDirectory path="/" physicalPath="C:\Src\Foo Bar" />
<!-- virtual directory; shared with parent app, so must be duplicated -->
<virtualDirectory path="/DocRoot" physicalPath="C:\Src\DocRoot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:5706:localhost" />
<binding protocol="https" bindingInformation="*:44300:localhost" />
</bindings>
</site>
Save and restart IIS Express.

Can I programmatically define my IIS7 site-bindings (eg. foo.domain.com)?

for my IIS7 website, i've had to go into the IIS7 Services Manager and define all the bindings for the site. Works fine.
I was wondering if it's possible to do this programatically in the web.config file instead? I know you can provide a few iis7 settings in there.. wasn't sure if it's possible to also include the bindings?
eg.
http; all unassigned ip's; port 80; foo.domain.com
https; 192.168.0.2; port 443; blah.domain.com
The configuration is found in the config file of the parent applicationHost.config, however I'm not sure it can be overridden. For example in IIS Express the section you are looking for is:
<system.applicationHost>
...
<sites>
<site name="Development Web Site" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_BIN%\AppServer\empty_wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="IISExpressAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
</system.applicationHost>
You could try running (sorry - I haven't tried any of these myself):
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.applicationHost
But from a security point of view it doesn't make sense to allow web.configs to each individually mess with system.applicationHost, as one site's config could break every other site.
Look at the Microsoft.Web.Administration namespace. you can then configure and maniuplate most of IIS 7 from C# code.
there is also a utility Appcmd that allows you to manipulate almost everything in IIS 7.0. be warned that this tool has tons of options and switches. I have only used it for the most basic of tasks such as changing physical directories on applications.

Resources