Tuesday, March 11, 2008

installscript configure website to use specific version of ASP.NET

After managing to register ASP.NET 1.1 the next step was to tell the newly installed website to use version 1.1 of ASP.NET, rather than the default.

This was done with the following function.

function ConfigureAspDotNetOnePointOne(hMSI)
STRING svRootVer, svMajMin, szApplicationPath, szVirtDir, szK, szS;
NUMBER nvType, nvSize, nIsFlag;
begin
//Check the registry to see how/if ASP.NET 1.1 is configured with IIS
//We'll be looking in the HKLM hive
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

//initialise to be sure of what started with
svRootVer = "";

//Try and read a value from the registry, which will exist if it is installed and registered
RegDBGetKeyValueEx("SOFTWARE\\Microsoft\\ASP.NET", "RootVer", nvType, svRootVer, nvSize);

StrSub(svMajMin, svRootVer, 0, 4);

//If path key does not exists, ASP.NET 1.1 is not registered with IIS
if (svMajMin != "1.1.") then
//Check it exists
nIsFlag = FILE_EXISTS;
szApplicationPath = WINDIR ^ "\\microsoft.net\\framework\\v1.1.4322\\aspnet_regiis.exe";
//Ensure that the path or filename is correctly enclosed in quotation marks,
LongPathToQuote(szApplicationPath, FALSE);
//Check if the exe file exists
if (Is (nIsFlag, szApplicationPath) == TRUE) then
//Get the name of the virtual dir
nvSize = 256;
MsiGetProperty(hMSI, "IIS_VIRTUAL_DIR", szVirtDir, nvSize);
//build command line arguments
szK = ' -k "W3SVC/1/Root/' + szVirtDir + '"'; //must quote as may contain spaces
szS = ' -s "W3SVC/1/Root/' + szVirtDir + '"';

//Register with IIS without script paths
LaunchAppAndWait(szApplicationPath, " -ir", WAIT);
//Remove any script path associations defaulted to new web application
LaunchAppAndWait(szApplicationPath, szK, WAIT);
//Associate new web application with desired ASP.NET version (1.1)
LaunchAppAndWait(szApplicationPath, szS , WAIT);
endif;
endif;

end;


I run this as a custom action in the Install Exec Sequence, after ScheduleReboot and with the condition 'Not Installed',

1 comment:

  1. The vast majority of women of all ages could take some sort of case as soon as your lover dissapear. It truly is a vital organ of the accompanying document for girls. Hauling some sort of custom made case, it's not only with the realistic louis vuitton replica, also for the fashion in addition to trendy. If you would like generally unique custom made carriers in addition to hold in close proximity having vogue although have no reason to devote generally with custom made carriers, fake custom made carriers will probably be your most suitable choice. Best places invest in fake custom made louis vuitton replica? Lovemypursemall. com generally is a very best website to present fake custom made carriers. It includes fake custom made carriers like LV purses and handbags, Gucci purses and handbags, Siphon purses and handbags, Hermes purses and handbags, louis vuitton replica purses and handbags and many others. Between a variety of models in addition to models connected with purses and handbags, you might have far more big decision in comparison with different web-sites. The products with lovemypursemall usually are most up-to-date and it also delivers one of a kind custom made louis vuitton replica and the majority hip purses and handbags with the consumers' decision. For anyone who is a person exactly who prefers up to date factors and exclusive inner thoughts, here's the suitable area available for you.

    ReplyDelete