$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
Today I needed to package an application that uses the Borland Database Engine (BDE).
The BDE is a database engine/connectivity component commonly used in Delphi and C++ Builder applications. It has been deprecated since 2000 when it was replaced by dbExpress.
But it’s still widely used so you may still find applications that require the BDE.
In my environment I already have a package for the BDE itsself. But the application I needed to package today, needs to have an Alias addded.
This is usually done manually by going into the BDEADMIN control panel applet or by copying the file where BDE saves the aliases (IDAPI32.CFG).
Here is a screenshot of the Alias my application needs (it uses an Interbase database):
I didn’t like the copy approach and didn’t even consider the manual option so I wrote 2 little tools.
13 Dec // php the_time('Y') ?>
I usually change the text below the “This Computer” icon to reflect the current username and servername:
This is an ancient trick, just set the the LocalizedString Value of the following key:
1 | HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} |
to “%USERNAME% on %COMPUTERNAME%”.
It get’s a little more complicated if you want to set this from a script, because the environment variables are replaced with the actual value BEFORE they are entered in the Registry.
If you read MSDN documentation for LSA_OBJECT_ATTRIBUTES you will think it’s defined in LsaLookup.h:
And that it’s supported since Windows 2000 but I couldn’t find it in this header file.
Instead I found it in NTSecAPI.h, so I decided to check the different SDK versions and starting from SDK v7 LsaLookup.h exists but in earlier SDK’s (v5.0, v6.0a and v6.1) there is no LsaLookup.h.
12 Dec // php the_time('Y') ?>
Last time I showed a User Defined Function to the Full Path of an Altiris Job given it’s id (event_id). Note that Altiris calls a Job an Event so the terms Event and Jobs are interchangeable here.
To complete it we first need to prepend the server and share name to the path.
I looked into the Altiris database tables to find the best place to get the servername and it seems that the hostname column of the mmsettings table is a good way.
In my database there was only one row in the table but I restrict the results by adding top 1:
1 | SELECT TOP 1 hostname FROM mmsettings |
Then I looked into the available tokens for one that returns a job id but we can only return a job name or a computer id. Since a job name is not unique I decided to use the computername and find the active job for this computer.
When a Job is scheduled an entry is added to the event_schedule table. If you look into this table you will notice a column status_code which is NULL initially and when the job start it will get a value of -1 which indicates the job is active.
When the job has finished the status will always be 0 or higher. Read the rest of this entry »
9 Dec // php the_time('Y') ?>
Earlier I described a SQL Query to get the Full Path of an Altiris Job, today I will describe how we can make a User Defined Function (UDF) in SQL so we can call it easier.
I am using an UDF because it allows us to specify parameters, in this case a single parameter (the EventId (or job id).
This is the SQL that creates the UDF:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | CREATE FUNCTION GetFullPath ( @EventId int) RETURNS nvarchar(4000) AS BEGIN DECLARE @str nvarchar(4000); WITH t1 (folder_id, name, parent_id, level) AS ( -- Anchor member definition SELECT folder_id, name, parent_id, 0 AS Level FROM event_folder WHERE folder_id in ( SELECT folder_id FROM event WHERE event_id = @EventId) UNION ALL -- Recursive member definition SELECT t2.folder_id,t2.name, t2.parent_id, Level+1 FROM event_folder AS t2, t1 WHERE t2.folder_id = t1.parent_id ) -- Statement that executes the CTE -- STUFF and FOR XML are used to Concatenate the Values and seperate them by \ character SELECT @str = STUFF((SELECT '\' + name from t1 order by level desc FOR XML PATH('')),1,1,'') RETURN @str END GO |
9 Dec // php the_time('Y') ?>
from CTX127541:
A cross-site scripting vulnerability has been identified in specific versions of Citrix Web Interface.
This vulnerability could potentially be used to execute malicious client-side script in the same context as legitimate content from the web server; if this vulnerability is used to execute script in the browser of an authenticated user then the script may be able to gain access to the authenticated user’s session or other potentially sensitive information.
This vulnerability affects all version 5.x Citrix Web Interface installations up to and including version 5.3.
So you should consider upgrading to version 5.4 which has a new look (again):
7 Dec // php the_time('Y') ?>
I wanted to query the full path name of an Altiris Job, this sounds easier that it is though.
Consider the following hierarchy:
Now I want to assemble the full Path, in this case: RPA\Getronics\PKG_p007.Citrix_Components.
6 Dec // php the_time('Y') ?>
I was trying to install a checked build of Windows 7 under VMWare Workstation but after the first reboot during the install (the completing installation step) the system came up with a BSOD.
It can be fixed by adding a line to the VMX configuration file:
piix4pm.smooth_acpi_timer = TRUE
I remembered from a previous project that when the Citrix Web Interface this is caused by a setting called generatePublisherEvidence in the Aspnet.config file.
This behaviour has been documented by Citrix in CTX117273.
If you read it carefully you will see the note that you need to fix it in 2 places for an x64 system.
If you know me a little than you have probably guessed I wanted to fix this with a nice script. I have chooses PowerShell this time because it has good support for XML and I made a one-liner so I can easily use it in an Embedded Altiris script.
The script changes the config file for both x86 and x64:
1 | gci "$env:WINDIR\Microsoft.NET\Framework*" | foreach {$x=[string]$_ + "\v2.0.50727\Aspnet.config";[xml]$c=Get-Content $x;$n=$c.configuration.runtime.generatePublisherEvidence;if($n -eq $null){$n=$c.CreateElement("generatePublisherEvidence");$c.configuration.runtime.AppendChild($n)};$n.SetAttribute("enabled",[string]$false);$c.Save($x)} |
EDIT: If you run by commandline you need to care of quotes within quotes, easiest thing to do is to use double quotes (“) to surround the commandline and use single quotes (‘) for Strings inside the commandline:
1 | powershell.exe "& {gci "$env:WINDIR\Microsoft.NET\Framework*" | foreach {[string]$x=($_.Fullname) + '\v2.0.50727\Aspnet.config';[xml]$c=Get-Content $x;$n=$c.configuration.runtime.generatePublisherEvidence;if($n -eq $null){$n=$c.CreateElement('generatePublisherEvidence');$c.configuration.runtime.AppendChild($n)};$n.SetAttribute('enabled',[string]$false);$c.Save($x)}}" |
I did an unattended install of the Citrix WebInterface on a testmachine and it failed with error 258.
The logfile clearly indicates the reason:
[ ERROR ] com.citrix.wi.install.SetupErrorReporter: Error 258 occurred: ASP.NET 2.0 must be registered and enabled in Microsoft Internet Information Services before the Web Interface can be installed.
We can register ASP.NET in IIS with the Aspnet_regiis.exe tool that comes with the .NET framework.
The commandline would be:
aspnet_regiis.exe -enable -ir
We do need to make sure we are using the proper version of the tool (x86 or x64), I did that in the Embedded Altiris Script:
1 2 3 4 5 6 7 8 9 10 | rem Register ASP.NET in IIS @echo off if %PROCESSOR_ARCHITECTURE%==AMD64 ( Set InstallPath=C:\Windows\Microsoft.NET\Framework64\v2.0.50727 ) else ( Set InstallPath=C:\Windows\Microsoft.NET\Framework\v2.0.50727 ) "%InstallPath%\aspnet_regiis.exe" -enable -ir |
Related Articles: