NsisIIS plug-in: Difference between revisions
Line 99: | Line 99: | ||
pop $0 | pop $0 | ||
NsisIIS::CreateWebSite sets "ServerBindings" Metabase parameter in C++, which accepts string format as "IP:Port:Hostname" (Microsoft Metabase Property ref.). Latest NsisIIS code(v2.0.1) has a bug to skip 1st character if no comma(,) is found. So we must pass "*" | NsisIIS::CreateWebSite sets "ServerBindings" Metabase parameter in C++, which accepts string format as "IP:Port:Hostname" (Microsoft Metabase Property ref.). Latest NsisIIS code(v2.0.1) has a bug to skip 1st character if no comma(,) is found. So we must pass "*" or " " in beginning of string to make it work. | ||
===NsisIIS::DeleteWebSite=== | ===NsisIIS::DeleteWebSite=== |
Revision as of 19:04, 6 November 2011
Author: Kamyar (talk, contrib) |
Links
NsisIIS.zip (16 KB)
Nsis IIS plugin page on SourceForge
Description
Version: 1.0.0
NsisIIS plugin to create/edit/delete/getinfo Microsoft IIS virtual directories and manage it's service status
Instructions:
- Copy NsisIIS.dll to Plugins folder of Nsis
- Read this readme and example files.
Functions
NsisIIS::CreateVDir
Creates an IIS virtual directory and sets its configuration, or just set the configuration if it already exists.
After calling, you MUST Pop the message, it can be the success or fail message. You can also put the settings to Nsis user variables $1 through $5. See the documentation for details.
Example: NsisIIS::CreateVDir "VDir Name" "Physical Path"
NsisIIS::DeleteVDir
Deletes an IIS virtual directory by its name. After calling, you MUST Pop the message, it can be the success or fail message.
Example: NsisIIS::DeleteVDir "VDir Name"
NsisIIS::GetVDir
Gets an IIS virtual directory configuration (if exists) and put it into user variables $1 through $5. See the documentation for details. After calling, you MUST Pop the message, it can be the success or fail message.
Example: NsisIIS::GetVdir "VDir Name"
NsisIIS::ListVDirs
Gets a list of IIS Virtual Directory names, as a comma separated string.
Example: NsisIIS::ListVDirs
NsisIIS::Start
Tries to start IIS service if stopped. After calling, you MUST Pop the message, it can be the success or fail message.
Example: NsisIIS::Start
NsisIIS::Stop
Tries to stop IIS service if started. After calling, you MUST Pop the message, it can be the success or fail message.
Example: NsisIIS::Stop
NsisIIS::Pause
Tries to pause IIS service if running. After calling, you MUST Pop the message, it can be the success or fail message.
Example: NsisIIS::Pause
NsisIIS::Resume
Tries to resume IIS service after calling Pause. After calling, you MUST Pop the message, it can be the success or fail message.
Example: NsisIIS::Resume
NsisIIS::GetIIsInfo
Gets IIS Information. Currently only the version as "major.minor" string in $0.
Example: NsisIIS::GetIIsInfo
NsisIIS::ListWebSites
Tries to get a list of IIS Web Site names, as comma separated "Id:Title" items into $1. Note that in ADSI (and metabase) websites are identified by their index (id), not the name (title or comment).
Example: NsisIIS::ListWebSites
NsisIIS::CreateWebSite
Creates a website getting its Name (Title), Physical Path, and Bindings respectively. Other optional parameters can be fed into $1 through $4. Bindings are in the format of ADSI standard: hostname:ip:port. The following line creates a website at port 8000, all headers and all assigned IPs.
Example:
StrCpy $1 "Classic .NET AppPool" StrCpy $2 "rs" StrCpy $3 "MyWebPage.htm" NsisIIS::CreateWebSite "MyWebSite" "D:\WebSite2" "*:8000:" pop $0
NsisIIS::CreateWebSite sets "ServerBindings" Metabase parameter in C++, which accepts string format as "IP:Port:Hostname" (Microsoft Metabase Property ref.). Latest NsisIIS code(v2.0.1) has a bug to skip 1st character if no comma(,) is found. So we must pass "*" or " " in beginning of string to make it work.
NsisIIS::DeleteWebSite
Deletes a website by getting its 1 based index (id).
Example:
NsisIIS::DeleteWebSite "2" pop $0
NsisIIS::GetWebSite
Gets a website information by getting its index (id). Result can be accessed via $0 through $5.
Example: NsisIIS::GetWebSite "2"
NsisIIS::ListAppPools
Lists all available IIS Application Pools as comma separated list of their names in $1.
Example: NsisIIS::ListAppPools
NsisIIS::CreateAppPool
Creates an Application Pool getting its name, and optionally other information through $1 to $3.
Example: NsisIIS::CreateAppPool "MyAppPool"
$1 Sets: .Net Framework Version, ex. "v2.0", "v4.0" $2 Sets: Managed Pipeline Mode $3 Sets: ?
For .Net Framework Version, word document example says "2", "4" which does not work. Source code (v2.0.1) sets managedRuntimeVersion property in C++,which must be in format of vX.Y http://technet.microsoft.com/en-us/library/cc754523(WS.10).aspx)
NsisIIS::DeleteAppPool
Deletes an Application Pool getting its ID.
Example: NsisIIS::DeleteAppPool "MyAppPool"
NsisIIS::GetAppPool
Tries to get an Application Pool information getting its name, and returning the result in variables $1 through $3.
Example: NsisIIS::GetAppPool "MyAppPool"
$1 Returns: ? $2 Returns: .Net Framework Version $3 Returns: Managed Pipeline Mode
TODO
- Adding support for Virtual Directories inside a Web Site.
- Adding support for managing another machine (not local) IIS.
- Adding support for SSL & authentication settings.
History
- 2/24/2010 Released version 1.0.0 & used in my installer.
- 7/21/2011 Released version 2.0.0 & used in my installer.