Jump to content











Photo
- - - - -

Unable to add registry Installer Classes entries - Citrix XenApp Hosted Client


  • Please log in to reply
48 replies to this topic

#1 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 06 April 2010 - 08:56 PM

I've been beating on an issue of trying to create a script for using the Citrix XenApp client from a LiveXP image. Everything seems to work fine but when I actually run the application I receive installer errors. It turns out Citrix requires installer registration to properly function. I've setup all the correct registry keys in the script file, but when I boot the iso I continually find that all entries in HKU\Classes\Installer and HKU\Microsoft\Windows\CurrentVersion\Installer are missing. All other registry entries seem to be created as expected. I used ConvRegToInf version 11009 to convert the output of RegShot into script format if that is applicable.

Does anyone know of a script or function in the LiveXP project that would be clearing out those registry areas towards the end of the process?

I'm attaching the Citrix script I've created in case I've just done something wrong in there.

4/7/10 - Updated script.

4/23/10 - Uploaded v6 to private site. This version is fully working though still has an issue with two registry entries. Citrix_XenApp_Hosted_Client.script

#2 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 06 April 2010 - 09:38 PM

LiveXP as well as some other PE have the annoying property of installing and registering dll during boot and thus some registry settings get always overwritten or deleted.
The only way to work around this is, to use a reg file with your settings and import it after those dll have been registered.

:whistling:

#3 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 06 April 2010 - 11:05 PM

The script needs some tidying to remove hard-coded paths, possibly the issue could lie there too.

Some entries may possibly need to be added at boot-time. For this you can use the RegAddBoot command instead of reg_add.

Regards,
Galapo.

#4 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 07 April 2010 - 12:15 PM

I knew there could be some cleanup done, and was hoping to eventually get it to a point where others could use it, but my initial requirement is just to get things working.

I'll give the RegAddBoot command a try, but do you know if there is a list of registry sections that might get nuked by the build process and thus need to be added at boot? I hate to just start converting all my registry entries to that if I don't need to, and some things I'm working on like this have 1000's of entries that I'd rather not try to search for each one to make sure it got built in correctly.

Thanks.
-Raetha

The script needs some tidying to remove hard-coded paths, possibly the issue could lie there too.

Some entries may possibly need to be added at boot-time. For this you can use the RegAddBoot command instead of reg_add.

Regards,
Galapo.



#5 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 07 April 2010 - 12:24 PM

- Run your script stand alone. (First create the needed directories in %target%)
- Export everything to reg files.
- Run a full build.
- After bootup export the whole registry, or at least all hives that your sript writes to.
- save the files
- compare the exported reg files from the booted system with the ones which were create from just your script. (You can use Advanced Registry Tracer for that.)

E viola you have a list of all keys that have been deleted or overwritten.

:dubbio:

#6 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 07 April 2010 - 01:29 PM

Thanks, that doesn't sound too bad. :whistling:

- Run your script stand alone. (First create the needed directories in %target%)
- Export everything to reg files.
- Run a full build.
- After bootup export the whole registry, or at least all hives that your sript writes to.
- save the files
- compare the exported reg files from the booted system with the ones which were create from just your script. (You can use Advanced Registry Tracer for that.)

E viola you have a list of all keys that have been deleted or overwritten.

:dubbio:



#7 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 07 April 2010 - 05:20 PM

I took a look at trying to do this, and realized I have no idea how. I setup an empty target, but don't see any registry files even being created there. So am not sure how to export the reg files. If you would please point me in the right direction.

- Run your script stand alone. (First create the needed directories in %target%)
- Export everything to reg files.
- Run a full build.
- After bootup export the whole registry, or at least all hives that your sript writes to.
- save the files
- compare the exported reg files from the booted system with the ones which were create from just your script. (You can use Advanced Registry Tracer for that.)

E viola you have a list of all keys that have been deleted or overwritten.

:whistling:



#8 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 07 April 2010 - 05:31 PM

I've done some tidying at this point, swapping in variables where I could figure them out, though not sure what to use for "X:\i386".

I also converted all the known trouble entries to RegAddBoot, and some of them are working fine. However the Software\Classes\Installer\Assemblies\X:|Program Files|Citrix|ICA Client|XPSPrintHelper.exe entry and all of the Software\Microsoft\Windows\CurrentVersion\Installer entries are still missing. Any ideas on what else might be impacting this? Or what else I should look at? The build does use PENetwork, HWPNP and Windows Installer in case any of those might be doing something after boot to cause issues.

Updated script attached to original entry.

The script needs some tidying to remove hard-coded paths, possibly the issue could lie there too.

Some entries may possibly need to be added at boot-time. For this you can use the RegAddBoot command instead of reg_add.

Regards,
Galapo.



#9 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 07 April 2010 - 06:25 PM

I took a look at trying to do this, and realized I have no idea how. I setup an empty target,

Simply create first the full project and do what i've told you, then go to the target folder and delete all files but leave all directories.
Then run just your script and do what i've already told you.

:whistling:

#10 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 08 April 2010 - 02:07 AM

I also converted all the known trouble entries to RegAddBoot, and some of them are working fine. However the Software\Classes\Installer\Assemblies\X:|Program Files|Citrix|ICA Client|XPSPrintHelper.exe entry and all of the Software\Microsoft\Windows\CurrentVersion\Installer entries are still missing.

Hmmm, you've got some issues here!

Regarding the second registry entries, I do not know why they aren't being written, or maybe they are being deleted by something?

Regarding the first registry entry, it is a reg_multi_sz entry, which is currently unsupported by the PE1x API function. I've now coded support for this and will upload the necessary updates a bit later on.

This means that now 0x1, 0x2, and 0x7 entries are supported, the rest aren't. Which means RegAddBoot won't accomplish what you want. You'll need to import a REG file of some kind as MedEvil has suggested.

In your script, for the 0x1 registry entries which contain %PE_Programs% etc., you need to change these to 0x2 entries. Entries with 'X:\i386' need to be changed to 0x2 and the 'X:\i386' string replaced with '%SystemRoot%'.

Comment out this line: 'reg_add,0x2,"%reg%\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common Templates","%systemdrive%\Documents and Settings\All Users\Templates"'.

Hope this helps.

Regards,
Galapo.

#11 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 08 April 2010 - 02:42 AM

Well, I decided that I may as well get around to coding support also for 0x3 and 0x4 entries.

I'll issue the updates to the LiveXP server once I've synchonised my local project files with Lancelot's updates there.

Regards,
Galapo.

#12 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 08 April 2010 - 03:02 PM

Sounds reasonable, and thanks for adding that support in. Can you briefly explain a couple things for me.

First what do the different reg entry types actually mean, I've just been using the ConvRegToInf utility and have no idea what the types actually line up to, but figured that program was taking care of things correctly.

Second, since I start with a reg export it's no problem to import that, but is there some build in call or program to support that? Or would I need to do something like add a Startup folder entry to run the reg file?

Thanks to both you and MedEvil for the help, it's gotten me a lot farther than I was getting on my own.

-R

Hmmm, you've got some issues here!

Regarding the second registry entries, I do not know why they aren't being written, or maybe they are being deleted by something?

Regarding the first registry entry, it is a reg_multi_sz entry, which is currently unsupported by the PE1x API function. I've now coded support for this and will upload the necessary updates a bit later on.

This means that now 0x1, 0x2, and 0x7 entries are supported, the rest aren't. Which means RegAddBoot won't accomplish what you want. You'll need to import a REG file of some kind as MedEvil has suggested.

In your script, for the 0x1 registry entries which contain %PE_Programs% etc., you need to change these to 0x2 entries. Entries with 'X:\i386' need to be changed to 0x2 and the 'X:\i386' string replaced with '%SystemRoot%'.

Comment out this line: 'reg_add,0x2,"%reg%\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common Templates","%systemdrive%\Documents and Settings\All Users\Templates"'.

Hope this helps.

Regards,
Galapo.



#13 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 April 2010 - 03:51 PM

Use the official Winbuilder Tool Reg2WBS.
If you want to merge a reg file at boot, you can eighter use the startupfolder or the runonceex key in the registry.
As programm to import, you can eighter use reg.exe or regedit.exe.

:huh:

#14 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 08 April 2010 - 05:08 PM

When trying to use the Reg2WBS program I get access violation errors that look like:

D:\>reg2WBSprg.exe -f:citrix.reg -o:citrix.script -H -E -A -R -0 -W -B
Exception EAccessViolation in module reg2WBSprg.exe at 00002BA9.
Access violation at address 00402BA9 in module 'reg2WBSprg.exe'. Read of address 00A0FFFC.

I'm guessing some of those funky registry keys are killing it.

However, as you both have mentioned I'm not sure that the conversion matters since the keys appear to be getting killed off. I've had good luck with the RegAddBoot calls with the exception of the Software\Microsoft\Windows\CurrentVersion\Installer tree. However ExpEnvVar seems to be doing the correct things, as if I run it once the image has fully booted it does create the missing registry entries. So something in the boot process that happens after EEV runs is killing the entries. I've looked through the original RunOnceEx entries and tried reapplying them and nothing seems to kill the entries once they have been recreated. So I'm a tad lost.

I'm going to try importing the registry entries as a whole post boot and see if they still get killed.

#15 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 08 April 2010 - 09:13 PM

Added the reg import as a 500 series RunOnceEx entry and got the same behavior as using the RegAddBoot. But again doing the import once the system is up seems to work fine. So I think it's a timing issue. I'm running through each number series in the RunOnceEx tree to see if I can determine what process might actually be breaking the import. I'll report back tomorrow on what I find.

#16 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 08 April 2010 - 09:57 PM

Try 999 for the RunOnceEx entry as this'll be the last one. If that doesn't work, try using Microsoft\Windows\CurrentVersion\Run as this is processed later.

Also in your script you'll need to change the first RegAddBoot line to these two lines:

StrFormat,REPLACE,%PE_Programs%,\,|,%New_Prog%

RegAddBoot,HKLM,0x7,"Software\Classes\Installer\Assemblies\%New_Prog%|Citrix|ICA Client|XPSPrintHelper.exe","XPSPrintHelper#$cVersion=#$q1.0.0.0#$q#$cRuntimeVersion=#$qv2.0.50727#$q#$cPublicKeyToken=#$q51be294c288ebe0d#$q#$cGUID=#$q0dadf4ef-8288-459d-9fa0-1f1f1f89090a#$q#$cCulture=#$qneutral#$q#$cprocessorArchitecture=#$qX86#$q","aSm26G2Uf=Suvg2jvffOICA_Client>`$I*%Z'Gl8Kv5j1^BVPT"

Regards,
Galapo.

#17 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 09 April 2010 - 12:50 PM

Found the problem. It's one of the entries for adding Windows Installer in RunOnceEx\900; "hiderun /w msiexec.exe /regserver" or "hiderun /w net start msiserver". Unfortunately the Windows Installer package was a dependancy for the Citrix client as well, so I do need to leave it in the project.

My guess without truly understanding the Windows Installer stack is that it must initialize those keys when first registered, thus removing anything already there. I suspect this problem is within the MS code and not something that could be easily fixed but simply needs to be worked around.

So my question back to you, Galapo, is does it make sense for you to change the API and have ExpEnvVar run later in the process, like in the 999 slot? That would allow anyone doing post boot registry entries to use the RegAddBoot function without having to also or instead create their own RunOnceEx entry with partial or full registry values to be imported later.

If you don't like the idea of changing when ExpEnvVar runs, what do you think my best bet is, import all the registry keys at boot time? Or just import the installer ones, and have the rest use normal API commands to get added at build time?

I'm still hoping when done that I can contribute this script back to the comunity in case anyone else works in a Citrix environment, so I want things to make as much sense as possible.

Thanks for all the help.
-Raetha

#18 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 13 April 2010 - 08:58 PM

Galapo,

Any response to my last question about possibly moving ExpEnvVar.exe to run later in the process than the Windows installer?

Thanks,
-Raetha

#19 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 14 April 2010 - 05:23 AM

Hi Raetha,

Sorry about that. I've been tied up the last couple of days as my router died and I had trouble setting up the new one (not solved until I happened to discover a beta firmware hidden on the internet somewhere and flashed the new router).

I'm a little bit wary of setting it higher as some 550 entries possibly may depend on ExpEnvVar.exe having run at 500 level.

So what I've done is alter the MSI installer script to have the msi.dll registration performed at 450. Download the new script from the LiveXP server and see if it works for you.

Regards,
Galapo.

#20 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 14 April 2010 - 05:27 AM

Sorry, I just noticed that you referred to the couple of 900 level entries.

See if the new script works without altering these. Post back with the result.

Thanks,
Galapo.

#21 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 14 April 2010 - 02:26 PM

No worries on delay, I know how life sometimes gets busy. Hope the router stays happy for you! ;)

Just gave it a try with using RegAddBoot rather than my own reg import. Seeing the same thing with the Software/Microsoft/Windows/CurrentVersion/Installer registry tree being empty. So I would confirm that it's those 900 series installer entries giving me grief. Could those be moved further up the process?

Again, if it's too much pain, I'm ok with using the reg file solution, I'm just thinking there's gotta be another person out there banging their head against a similar problem.

Thanks,
Raetha

#22 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 15 April 2010 - 12:36 AM

Ok, new MSI installer script is now on the LiveXP server. I've altered the other RunOnceEx entries. I tested installing a few MSI files and it's working for me.

Regards,
Galapo.

#23 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 15 April 2010 - 07:56 PM

Not sure if the timing doesn't work or something, but now it's definitely broken, and appears to be the windows installer. I've got all the registry keys, but when installer items try to run they fail. I went ahead and tried a full install of the Citrix client in the PE session and now get a failure message saying "The installation ended prematurely because of an error." The Citrix installer had been working, as that was how I had been testing. So not sure if you might have accidentally hit something else in the Windows Installer script, but if not maybe we need to revert those changes and I'll just use a reg file for the pieces that aren't working.

#24 Raetha

Raetha

    Newbie

  • Members
  • 23 posts
  • Location:US - NH
  •  
    United States

Posted 15 April 2010 - 08:45 PM

Amendment to earlier comments. I just rebuilt using the full reg file and things seem to be working again. There must be something wrong or missing from the script. I'll keep whacking at this early next week. At least progress is being made.

#25 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 15 April 2010 - 10:51 PM

The Citrix installer had been working, as that was how I had been testing. So not sure if you might have accidentally hit something else in the Windows Installer script, but if not maybe we need to revert those changes and I'll just use a reg file for the pieces that aren't working.

So the installer had been working but isn't now. Is that still the case?

Nothing else was adjusted in the script apart from altering the three RunOnceEx entries. The MSI files I tried to install in my test all worked fine (well, apart from one which failed since .NET wasn't installed).

Thanks,
Galapo.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users