ASP.NET Web Setup - installation

I have 3 web projects in a Visual studio solution.I want to create a single web setup project which should install all 3 web projects in their virtual directories.So how to create a single web setup project which supports multiple web application installation?

You can do this by creating a Web Setup Project. In the File System add as many Web Custom Folders as you need.
Only the main Web Application Folder will have the installation dialog so if you want to customize the virtual directory names then you will need to add a screen and set the Property of the web custom folder to be the same as the field name on the screen you add.

I never found the whole "web setup project" concept to work well. For starters, I've never managed a web server where the only site configuration was the default web site, so the "out of the box" functionality of defining a virtual directory to be created on the default site never worked for me, and it doesn't sound like it would be very useful to you either.
The best option I've found is to create a standard setup project that installs the output + content files of each web site into a \\Website path (or similar) and write a custom installer action with a supporting GUI that allows the installer (user) to select the proper web site and specify the name of the virtual directory to be used.

As John Hunter said, it is possible to add multiple Web Custom Foldsers beside the default Web Appplication Folder. But you need to know some details about how things add up.
One thing to notice is that the Property name you set for the additional folder will be the physical path of the installation. This however is read only in your setup logic, because it is automatically set later as the location of the IIS default path (typically C:\intepub\wwwroot\) added with the value specified in VirtualDirectory on the folder properties. So what you need to set in the custom screen you add, is not the Property name defined on the folder, but the property name that is used for the virtual directory. This is the Property name you specify appended with "VDIR". So if the property name you specify for the web folder is "WEBSITE1", then the property name for the virtual folder will be "WEBSITE1VDIR". In your custom screen, you then need to set up the property name for the text field you use to "WEBSITE1VDIR", The default value in this textbox will be automatically populated with you default VirtualDirectory value specified on the folder.
If you choose to remove the default Installation Address dialog so you specify also the main web site in a custom text box on the same page as the others, you need to know that the property name for the physical path as you see grayed out is fixed to "TARGETDIR" in the Property name for the "Web Application Folder". However, the property for the virtual path is not "TARGETDIRVDIR" as it would be if it followed the same name convention as the other, but it is "TARGETVDIR".
But if you do remove the default Installation Address dialog, you loose the option to select the web site to use (typically "Default Web Site") and Application pool from drop downs that shows you what is available.

Related

where are the IIS server settings stored?

I have installed url rewrite tool. I have set a global rule by right clicking on the server name (not a website name) and created a rule.
Now I want to edit this rule manually but I don't know where these settings are stored? when I create a rule for a website, it is stored in web.config but in this case I created rule for whole server and I can not find where it is stored? Is it stored as windows registry key? Do browsers look for windows registries rather than the web.config to ask for rules?
When doing a configuration via IIS Manager, the statusbar shows into which file the settings will be stored. At server level it mostly is applicationHost.config which is stored at %windir%\System32\inetsrv\config\applicationHost.config.

USERPROFILE as Default Location

Can one use a folder that includes USERPROFILE as Default location in Visual Studio setup?
By default it shows as
[ProgramFilesFolder][Manufacturer]\[ProductName]
Changing [ProgramFilesFolder] to [USERPROFILE] like the one shown below doesn't seem to work
C:\Users\[USERPROFILE]\AppData\Roaming\CarriageWay
It does creates create a folder but it doesn't go to its intended target, totally ignores the "userprofile" name, say Ricardo for one. It may be any name.
C:\Users\AppData\Roaming\CarriageWay
Any ideas?
As it turned out, one needs to include "User's Application Data Folder" under File System on Target Machine [AppDataFolder] and add folders under that.
Not to be confused with the Default location under Applications folder.

Eclipse RCP App: How can I prompt the user to set the workspace

I want my RCP app to always prompt the user for the workspace location. I can specify a default location either with the -data arg in eclipse.ini or the osgi.instance.area.default property in configuration/config.ini. But I don't want the user to have to know about and edit either of these files to change the workspace location.
Setting the preference Prompt for workspace on startup has no effect. I launch the app in a clean workspace, with no -data arg or osgi.instance.area.default property set, and it creates a workspace folder in the current directory, and does not prompt to select a location.
I use a copy of the IDEApplication class for my application. I see that in line 188 which is one of the first lines run after start(), the platform location is already set, and this prevents the dialog from showing. I don't know why it's already set before even trying to launch the UI, and setting the preference has no effect. (I verified in configuration/.settings/org.eclipse.ui.ide.prefs that SHOW_WORKSPACE_SELECTION_DIALOG=true).
I tried re-setting the location by adding
instanceLoc = instanceLoc.createLocation(instanceLoc, null, false);
at the beginning of checkInstanceLocation(). This enables the workspace chooser dialog to come up, but setting the location this way has no effect on what the app actually uses for its instance area when it launches.
I thought that maybe some earlyStartup code in my app may be interfering, as I read that if you access the preferences too soon you can prevent the workspace chooser from opening. So I commented out the few earlyStartup declarations I had, and still I can't get the workspace chooser dialog to show.
The problem turned out to be that some classes loaded as dependencies of my OSGI service were accessing the class ResourcesPlugin, which causes the workspace location to be set immediately. Since this was happening before the workspace chooser dialog was launched, the location used was the value of the -data arg if specified, otherwise $(pwd)/workspace.
I tried resolving the issue by adjusting the start level of my service plug-in. With a start level of 7 or higher, the workspace chooser dialog was no longer pre-empted. However, the service did not work properly then. After numerous unsuccessful attempts to make the service work properly with a custom start level, I abandoned that approach and re-worked my code so the reference to ResourcesPlugin occurs later in the application startup process. Specifically, I moved it to the postWindowOpen method of my custom WorkbenchWindowAdvisor implementation.

Dynamically change About dialog text in RCP based application

Are is possible to dynamically change About dialog text in RCP based application? I want to replace aboutText value when About dialog opens by dynamically changing some part of it's text. Problem is that I has a client/server application, where information about client can be static, but server information (at least version string) may change independently and I don't know when it will happen. aboutText itself is static text. about.mapping approach also not work, because this file is packed into application JAR and because of this is read-only too. Are there is a possibility to subclass aboutText or update it in another way before About dialog show it? I not want to rewrite the all Eclipse About dialog class from scratch.
You can use system properties in about.mappings to achieve this:
Create an about.mappings file at the root of your app plugin
Add lines such as 0=$net.dnorth.about.text$
Reference {0} in the aboutText set in plugin.properties
Now call System.setProperty("net.dnorth.about.text", "your dynamic text here") in some code at start-up.
Reference: https://bugs.eclipse.org/bugs/show_bug.cgi?id=172692
The about text of the IDE is instance specific i.e if you are running a RCP application then at that time you cant change the About text.It is only possible if you update your RCP with via Check for updates link or if you install another IDE over the present one.
I these two cases only you can change your about text.

Create virtual directory at http://localhost/

Hi I would like to create a virtual directory at http://localhost
Its just a standard IIS 7.5 installation, meaning that http://localhost/ just shows the iis logo. But how do I remove that page and make it possible to use it for at virtual directory.
Right now Im getting this message in Visual Studio, when Im trying to create the virtual directory.
"Unable to create the virtual directory. The URL 'http://localhost/' is already mapped to a different folder location."
I can create a virtual directory at ex. http://localhost/web But I need it to be a http://localhost/
What you want is not a virtual directory. Just change the physical path of your Default Web Site to where you want it, or publish into that folder. By default the physical path is c:\inetpub\wwwroot\.
Default Web Site -> Manage Web Sites -> Advanced Settings -> Physical Path
Right click the folder that you want to make as the virtual directory.
Under Properties->Web Sharing select the Default website.
Also click the option Share this folder. In Aliases give the name of the folder. Now click OK.
There's nothing "virtual" about the directory mapped to http://localhost. That's your web root, likely located at c:\inetpub\wwwroot\. You should be able to publish directly to that.
A Virtual Directory is basically configuring IIS to internally create a folder under the web root which points to a different folder on the file system, as opposed to one actually located under the web root folder. It doesn't sound like you need that.

Resources