It is currently Tue Apr 16, 2024 7:42 am

All times are UTC - 7 hours [ DST ]

Recent News:



Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Tue Nov 24, 2009 10:29 am 
Offline
1TB storage
1TB storage

Joined: Wed Sep 30, 2009 7:28 pm
Posts: 36
Thanks: 8
Thanked: 0 time in 0 post
I currently have a wix installer that has a C# custom action. This wix installer runs great on a WHS when directly logged in or remote desktoped into it. The custom action runs great and retrieves information about the default website on IIS.

The wix installer fails when I try to run it through the WHS Console. I know it fails to run the custom action because the error that comes back would not be shown if the CA had run.

Are custom actions supported within the WHS console?


Top
 Profile  
Thanks  

Attention Guest: Remove this ad by Registering with the MediaSmartServer.net Forums. It's Free!
PostPosted: Tue Nov 24, 2009 10:42 am 
Offline
Founder
Founder
User avatar

Joined: Tue Jul 31, 2007 11:54 am
Posts: 10735
Location: Fort Collins, Colorado
Thanks: 630
Thanked: 931 times in 885 posts
Hopefully Cougar chimes in as he's more of a Wix expert than I am, but I believe custom actions should be fine. If it's a C# custom action it may depend on a specific .NET version (2.0 is the default on WHS though 3.5 can be installed via updates, it's dangerous to depend on it being there IMHO). Also WHS requires the install to be non-interactive. Perhaps if you tell us more of what you're trying to do or even share your custom action we may have some ideas.

_________________
Alex Kuretz
Remote Notification: Monitoring and alerting for your Home Server via email, Twitter, text message, RSS, push notifications, and on your Mac desktop
Have you tried our Add-Ins?


Top
 Profile  
Thanks  
PostPosted: Tue Nov 24, 2009 12:19 pm 
Offline
1TB storage
1TB storage

Joined: Wed Sep 30, 2009 7:28 pm
Posts: 36
Thanks: 8
Thanked: 0 time in 0 post
Sure! The Wix installer currently has no support for customer headers or ports for an IIS website. In my case if the default website has been configured to use non default values for either the port or header then my WIX installer will fail and not be able to create a virtual directory under the default website. The Wix user group even replied back to me stating they have no support for this and a custom action is needed.

Sooooo I have hacked some code together from the help of (http://blog.torresdal.net/CommentView,g ... 27C6D.aspx). Below is the code. Basically it sets sessions variables for the PORT/Header/IP of the default website. Nothing terribly confusing.

Code:
using System;
using System.DirectoryServices;
using Microsoft.Deployment.WindowsInstaller;

namespace IISCustomAction
{
    public class CustomActions
    {
        [CustomAction]
        public static ActionResult GetWebSites(Session session)
        {
            try
            {

                DirectoryEntry iisRoot = new DirectoryEntry("IIS://localhost/W3SVC");

                foreach (DirectoryEntry webSite in iisRoot.Children)
                {
                    if (webSite.SchemaClassName.ToLower() == "iiswebserver" &&
                        webSite.Name.ToLower() != "administration web site")
                    {
                        if (webSite.Properties["ServerComment"].Value.ToString() == "Default Web Site" )
                        {
                            string[] serverBindings = ((string)webSite.Properties["ServerBindings"].Value).Split(':');
                            session["WEBSITE_IP"] = serverBindings[0];
                            session["WEBSITE_PORT"] = serverBindings[1];
                            session["WEBSITE_HEADER"] = serverBindings[2];
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                session.Log("CustomActionException: " + ex.ToString());
                return ActionResult.Failure;
            }
            return ActionResult.Success;
        }

       
    }
}


My wix then takes the session variables into the IIS Component like so:

Code:
<iis:WebSite Id='DefaultWebSite' Description='Default Web Site'>
  <iis:WebAddress Id="AllUnassigned" Port="[WEBSITE_PORT]" IP="[WEBSITE_IP]" Header="[WEBSITE_HEADER]" />
</iis:WebSite>

<InstallUISequence>
      <Custom Action="GetIISWebSites" After="CostFinalize" Overridable="yes" />
</InstallUISequence>
   
<CustomAction Id="GetIISWebSites" BinaryKey="IISCA" DllEntry="GetWebSites" Execute="immediate"  Return="check" />
<Binary Id="IISCA" SourceFile="C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\IISCustomAction\bin\Debug\IISCustomAction.CA.dll" />



There is more code in my wix that sets registry keys as well based on these values. Registry keys are needed to allow for the uninstallation of the virtual directory under the default website.


Top
 Profile  
Thanks  
PostPosted: Tue Nov 24, 2009 12:47 pm 
Offline
Founder
Founder
User avatar

Joined: Tue Jul 31, 2007 11:54 am
Posts: 10735
Location: Fort Collins, Colorado
Thanks: 630
Thanked: 931 times in 885 posts
Have you checked the Additions log on the server for specific failure messages?

_________________
Alex Kuretz
Remote Notification: Monitoring and alerting for your Home Server via email, Twitter, text message, RSS, push notifications, and on your Mac desktop
Have you tried our Add-Ins?


Top
 Profile  
Thanks  
PostPosted: Tue Nov 24, 2009 1:26 pm 
Offline
1TB storage
1TB storage

Joined: Wed Sep 30, 2009 7:28 pm
Posts: 36
Thanks: 8
Thanked: 0 time in 0 post
No I haven't but I will do that in the next hour and report back. Thanks for pointing out that log file.


Top
 Profile  
Thanks  
PostPosted: Tue Nov 24, 2009 2:14 pm 
Offline
Founder
Founder
User avatar

Joined: Tue Jul 31, 2007 11:54 am
Posts: 10735
Location: Fort Collins, Colorado
Thanks: 630
Thanked: 931 times in 885 posts
Yeah that's going to be the best way to tell why the install is failing. They are stored in C:\Documents and Settings\All Users\Application Data\Microsoft\Windows Home Server\logs.

_________________
Alex Kuretz
Remote Notification: Monitoring and alerting for your Home Server via email, Twitter, text message, RSS, push notifications, and on your Mac desktop
Have you tried our Add-Ins?


Top
 Profile  
Thanks  
PostPosted: Tue Nov 24, 2009 2:27 pm 
Offline
1TB storage
1TB storage

Joined: Wed Sep 30, 2009 7:28 pm
Posts: 36
Thanks: 8
Thanked: 0 time in 0 post
Well this log basically tells me that the custom action isnt running because the property in wix is not getting set. Why wouldnt my CA be running in the WHS Console? =( It runs fine outside of the WHS Console.

Created at 11/24/2009 12:19:05 PM
***** Started at 11/24/2009 12:19:05 PM ***
***** Closed at 11/24/2009 12:19:05 PM ***
=== Logging started: 11/24/2009 12:19:05 ===
Action start 12:19:05: INSTALL.
Action start 12:19:05: AppSearch.
Action ended 12:19:05: AppSearch. Return value 1.
Action start 12:19:05: LaunchConditions.
Action ended 12:19:05: LaunchConditions. Return value 1.
Action start 12:19:05: ValidateProductID.
Action ended 12:19:05: ValidateProductID. Return value 1.
Action start 12:19:05: CostInitialize.
Action ended 12:19:05: CostInitialize. Return value 1.
Action start 12:19:05: FileCost.
Action ended 12:19:05: FileCost. Return value 1.
Action start 12:19:05: CostFinalize.
Action ended 12:19:05: CostFinalize. Return value 1.
Action start 12:19:05: InstallValidate.
Action ended 12:19:05: InstallValidate. Return value 1.
Action start 12:19:05: InstallInitialize.
Action ended 12:19:05: InstallInitialize. Return value 1.
Action start 12:19:05: ProcessComponents.
Action ended 12:19:05: ProcessComponents. Return value 1.
Action start 12:19:05: UnpublishFeatures.
Action ended 12:19:05: UnpublishFeatures. Return value 1.
Action start 12:19:05: RemoveRegistryValues.
Action ended 12:19:05: RemoveRegistryValues. Return value 1.
Action start 12:19:05: UninstallCertificates.
Action ended 12:19:05: UninstallCertificates. Return value 1.
Action start 12:19:05: RemoveFiles.
Action ended 12:19:05: RemoveFiles. Return value 1.
Action start 12:19:05: RemoveFolders.
Action ended 12:19:05: RemoveFolders. Return value 1.
Action start 12:19:05: CreateFolders.
Action ended 12:19:05: CreateFolders. Return value 1.
Action start 12:19:05: InstallFiles.
Action ended 12:19:05: InstallFiles. Return value 1.
Action start 12:19:05: InstallCertificates.
Action ended 12:19:05: InstallCertificates. Return value 1.
Action start 12:19:05: ConfigureIIs.
Action start 12:19:06: StartMetabaseTransaction.
Action ended 12:19:06: StartMetabaseTransaction. Return value 1.
Action start 12:19:06: RollbackMetabaseTransaction.
Action ended 12:19:06: RollbackMetabaseTransaction. Return value 1.
Action start 12:19:06: CommitMetabaseTransaction.
Action ended 12:19:06: CommitMetabaseTransaction. Return value 1.
Action start 12:19:06: ConfigureIIsExec.
Action ended 12:19:06: ConfigureIIsExec. Return value 1.
Action start 12:19:06: WriteMetabaseChanges.
Action ended 12:19:06: WriteMetabaseChanges. Return value 1.
Action ended 12:19:06: ConfigureIIs. Return value 1.
Action start 12:19:06: WriteRegistryValues.
Action ended 12:19:06: WriteRegistryValues. Return value 1.
Action start 12:19:06: RegisterUser.
Action ended 12:19:06: RegisterUser. Return value 1.
Action start 12:19:06: RegisterProduct.
Action ended 12:19:06: RegisterProduct. Return value 1.
Action start 12:19:06: PublishFeatures.
Action ended 12:19:06: PublishFeatures. Return value 1.
Action start 12:19:06: PublishProduct.
Action ended 12:19:06: PublishProduct. Return value 1.
Action start 12:19:06: InstallFinalize.
ConfigureIIsExec: Error 0x8007000d: invalid port provided for web site:
ConfigureIIsExec: Error 0x8007000d: failed while processing WebSites
MSI (s) (F4!60) [12:19:08:848]: Product: P80 -- Error 26002. Failed while processing WebSites. (-2147024883 )

Error 26002. Failed while processing WebSites. (-2147024883 )
Action ended 12:19:08: InstallFinalize. Return value 3.
Action ended 12:19:34: INSTALL. Return value 3.
Property(S): Error = C:\Program Files\P80\Error\
Property(S): VirtualMemory = 3002
Property(S): StartMetabaseTransaction = ScaConfigureIIs
Property(S): RollbackMetabaseTransaction = ScaConfigureIIs
Property(S): CommitMetabaseTransaction = ScaConfigureIIs
Property(S): WriteMetabaseChanges = ConfigureIIs
Property(S): NETFRAMEWORK35 = #1
Property(S): TARGETDIR = D:\
Property(S): WHS = C:\Program Files\Windows Home Server\
Property(S): P80 = C:\Program Files\P80\
Property(S): Bin = C:\Program Files\P80\Bin\
Property(S): frFR = C:\Program Files\P80\fr-FR\
Property(S): jaJP = C:\Program Files\P80\ja-JP\
Property(S): CSS = C:\Program Files\P80\CSS\
Property(S): images = C:\Program Files\P80\images\
Property(S): AutoExit = C:\Program Files\P80\images\AutoExit\
Property(S): folders = C:\Program Files\P80\images\folders\
Property(S): Services = C:\Program Files\P80\images\Services\
Property(S): ConfigureIIsExec = ConfigureIIs€1€0€0€2€1€0€0€2€1€16€1€AppPool€1€Name€1€Component_€1€Attributes€2€User_€1€RecycleMinutes€2€RecycleRequests€2€RecycleTimes€1€VirtualMemory€2€PrivateMemory€2€IdleTimeout€2€QueueLimit€2€CPUMon€1€MaxProc€2€ISInstalled€2€ISAction€2€3€P80€P80€IISConf€4€€-2147483648€-2147483648€€-2147483648€-2147483648€-2147483648€-2147483648€0€-2147483648€2€3€4€2€1€0€0€2€1€0€0€2€1€0€0€2€1€15€1€DirProperties€1€Access€2€Authorization€2€AnonymousUser_€1€IIsControlledPassword€2€LogVisits€2€Index€2€DefaultDoc€1€AspDetailedError€2€HttpExpires€1€CacheControlMaxAge€2€CacheControlCustom€1€NoCustomError€2€AccessSSLFlags€2€AuthenticationProviders€1€3€WebVirtualDirProperties€517€1€€0€-2147483648€-2147483648€€-2147483648€€-2147483648€€-2147483648€-2147483648€€4€2€1€0€0€2€1€0€0€2€1€12€1€Name€1€Isolation€2€AllowSessions€2€SessionTimeout€2€Buffer€2€ParentPaths€2€DefaultScript€1€ScriptTimeout€2€ServerDebugging€2€ClientDebugging€2€AppPool_€1€Application€1€3€P80€0€-2147483648€-2147483648€-2147483648€-2147483648€€-2147483648€-2147483648€-2147483648€P80€WebApplication€4€2€1€0€0€2€1€20€1€Web€1€Component_€1€Id€1€Description€1€ConnectionTimeout€2€Directory_€1€State€2€Attributes€2€DirProperties_€1€Application_€1€Address€1€IP€1€Port€1€Header€1€Secure€2€Log_€1€ISInstalled€2€ISAction€2€SourcePath€1€TargetPath€1€3€DefaultWebSite€€€Default Web Site€-2147483648€€-2147483648€-2147483648€€€AllUnassigned€€€€0€€0€0€€€4€2€1€6€1€Address€1€Web_€1€IP€1€Port€1€Header€1€Secure€2€3€AllUnassigned€DefaultWebSite€€€€0€4€2€1€7€1€Web€1€Id€1€IP€1€Port€1€Header€1€Secure€2€Description€1€3€DefaultWebSite€€€€€0€Default Web Site€4€2€1€0€0€2€1€11€1€Web_€1€VirtualDir€1€Component_€1€Alias€1€Directory_€1€DirProperties_€1€Application_€1€ISInstalled€2€ISAction€2€SourcePath€1€TargetPath€1€3€DefaultWebSite€VirtualDir€IISConf€P80€P80€WebVirtualDirProperties€WebApplication€2€3€€C:\Program Files\P80\€4€2€1€0€0€2€1€0€0€2
Property(S): ProgramFilesFolder = C:\Program Files\
Property(S): SourceDir = C:\Documents and Settings\All Users\Application Data\Microsoft\Windows Home Server\
Property(S): Manufacturer = Snowdins Consulting
Property(S): ProductCode = {93AD93F0-AEBA-11DE-8A39-0800200C9A66}
Property(S): ProductLanguage = 1033
Property(S): ProductName = P80
Property(S): ProductVersion = 2.3.2
Property(S): UpgradeCode = {1A7C55F0-CEED-11DD-AD8B-0800200C9A66}
Property(S): WHSLogo = 1
Property(S): TARGETVDIR = P80
Property(S): SecureCustomProperties = NETFRAMEWORK35
Property(S): PackageCode = {4E2C0718-AC1A-44FC-A7BE-074134DCDD96}
Property(S): ProductState = -1
Property(S): PackagecodeChanging = 1
Property(S): CURRENTDIRECTORY = C:\Documents and Settings\Administrator\Desktop
Property(S): CLIENTUILEVEL = 2
Property(S): CLIENTPROCESSID = 3600
Property(S): VersionDatabase = 200
Property(S): VersionMsi = 3.01
Property(S): VersionNT = 502
Property(S): WindowsBuild = 3790
Property(S): ServicePackLevel = 2
Property(S): ServicePackLevelMinor = 0
Property(S): MsiNTProductType = 3
Property(S): MsiNTSuiteSmallBusiness = 1
Property(S): MsiNTSuiteSmallBusinessRestricted = 1
Property(S): WindowsFolder = C:\WINDOWS\
Property(S): WindowsVolume = C:\
Property(S): SystemFolder = C:\WINDOWS\system32\
Property(S): System16Folder = C:\WINDOWS\system\
Property(S): RemoteAdminTS = 1
Property(S): TempFolder = C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\
Property(S): CommonFilesFolder = C:\Program Files\Common Files\
Property(S): AppDataFolder = C:\Documents and Settings\Administrator\Application Data\
Property(S): FavoritesFolder = C:\Documents and Settings\Administrator\Favorites\
Property(S): NetHoodFolder = C:\Documents and Settings\Administrator\NetHood\
Property(S): PersonalFolder = C:\Documents and Settings\Administrator\My Documents\
Property(S): PrintHoodFolder = C:\Documents and Settings\Administrator\PrintHood\
Property(S): RecentFolder = C:\Documents and Settings\Administrator\Recent\
Property(S): SendToFolder = C:\Documents and Settings\Administrator\SendTo\
Property(S): TemplateFolder = C:\Documents and Settings\Administrator\Templates\
Property(S): CommonAppDataFolder = C:\Documents and Settings\All Users\Application Data\
Property(S): LocalAppDataFolder = C:\Documents and Settings\Administrator\Local Settings\Application Data\
Property(S): MyPicturesFolder = C:\Documents and Settings\Administrator\My Documents\My Pictures\
Property(S): AdminToolsFolder = C:\Documents and Settings\Administrator\Start Menu\Programs\Administrative Tools\
Property(S): StartupFolder = C:\Documents and Settings\Administrator\Start Menu\Programs\Startup\
Property(S): ProgramMenuFolder = C:\Documents and Settings\Administrator\Start Menu\Programs\
Property(S): StartMenuFolder = C:\Documents and Settings\Administrator\Start Menu\
Property(S): DesktopFolder = C:\Documents and Settings\Administrator\Desktop\
Property(S): FontsFolder = C:\WINDOWS\Fonts\
Property(S): GPTSupport = 1
Property(S): OLEAdvtSupport = 1
Property(S): ShellAdvtSupport = 1
Property(S): Intel = 15
Property(S): PhysicalMemory = 2048
Property(S): AdminUser = 1
Property(S): LogonUser = Administrator
Property(S): UserSID = S-1-5-21-2031166390-2734115312-2284603499-500
Property(S): UserLanguageID = 1033
Property(S): ComputerName = WHS
Property(S): SystemLanguageID = 1033
Property(S): ScreenX = 1024
Property(S): ScreenY = 768
Property(S): CaptionHeight = 19
Property(S): BorderTop = 1
Property(S): BorderSide = 1
Property(S): TextHeight = 16
Property(S): ColorBits = 32
Property(S): TTCSupport = 1
Property(S): Time = 12:19:34
Property(S): Date = 11/24/2009
Property(S): MsiNetAssemblySupport = 2.0.50727.3053
Property(S): MsiWin32AssemblySupport = 5.2.3790.3959
Property(S): RedirectedDllSupport = 2
Property(S): Privileged = 1
Property(S): USERNAME = Windows Home Server User
Property(S): COMPANYNAME = Family
Property(S): DATABASE = C:\WINDOWS\Installer\12d9cc61.msi
Property(S): OriginalDatabase = C:\Documents and Settings\All Users\Application Data\Microsoft\Windows Home Server\P80.2.3.2.msi
Property(S): UILevel = 3
Property(S): ACTION = INSTALL
Property(S): ROOTDRIVE = D:\
Property(S): CostingComplete = 1
Property(S): OutOfDiskSpace = 0
Property(S): OutOfNoRbDiskSpace = 0
Property(S): PrimaryVolumeSpaceAvailable = 0
Property(S): PrimaryVolumeSpaceRequired = 0
Property(S): PrimaryVolumeSpaceRemaining = 0
Property(S): INSTALLLEVEL = 1
Property(S): SOURCEDIR = C:\Documents and Settings\All Users\Application Data\Microsoft\Windows Home Server\
Property(S): SourcedirProduct = {93AD93F0-AEBA-11DE-8A39-0800200C9A66}
Property(S): ProductToBeRegistered = 1
MSI (s) (F4:34) [12:19:34:552]: Product: P80 -- Installation failed.

=== Logging stopped: 11/24/2009 12:19:34 ===


Top
 Profile  
Thanks  
PostPosted: Tue Nov 24, 2009 4:15 pm 
Offline
Uber Moderator
Uber Moderator
User avatar

Joined: Sun Dec 02, 2007 3:29 am
Posts: 1736
Location: Brighton, England
Thanks: 27
Thanked: 202 times in 152 posts
I'll take a quick crazy and half drunk punt that it works outside of the console as you are using a UI option (InstallUISequence) and the Add-In doesnt invoke a UI :-)

So, you'd need to do it as something like an InstallExecute?

_________________
Have you tried our Add-Ins? If so, be sure to Rate them at WeGotServed.
Help support MediaSmartServer.Net!


Top
 Profile  
Thanks  
The following user would like to thank Cougar for this post
snowdins, yakuza
PostPosted: Tue Nov 24, 2009 4:30 pm 
Offline
1TB storage
1TB storage

Joined: Wed Sep 30, 2009 7:28 pm
Posts: 36
Thanks: 8
Thanked: 0 time in 0 post
.... Who here feels like a dumb@#@!

ME!!!!!

lol Thanks man. I cant do the code change atm, but will when I get home. Pretty sure this is gonna do it. ..... DOH!


Top
 Profile  
Thanks  
PostPosted: Tue Nov 24, 2009 4:43 pm 
Offline
Uber Moderator
Uber Moderator
User avatar

Joined: Sun Dec 02, 2007 3:29 am
Posts: 1736
Location: Brighton, England
Thanks: 27
Thanked: 202 times in 152 posts
No worries, I do most of my CA's using InstallExecuteSequence and set it to Before InstallFinalize if that helps.

Code:
 <InstallExecuteSequence>
            <Custom Action="iisconfig" Before="InstallFinalize" />
        </InstallExecuteSequence>

_________________
Have you tried our Add-Ins? If so, be sure to Rate them at WeGotServed.
Help support MediaSmartServer.Net!


Top
 Profile  
Thanks  
The following user would like to thank Cougar for this post
snowdins, yakuza
PostPosted: Tue Nov 24, 2009 7:21 pm 
Offline
1TB storage
1TB storage

Joined: Wed Sep 30, 2009 7:28 pm
Posts: 36
Thanks: 8
Thanked: 0 time in 0 post
Yup that was it. Thanks so much =) Time to release to testers now! woooooooooooot!


Top
 Profile  
Thanks  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group