AppV Debugging

From richud.com
Jump to navigation Jump to search


Services

e.g. AutoCad needing FLEXnet licensing service.

Services the app need may need [subinacl.exe] to modify the service permissions for 'Everyone' to be be able to start/stop etc INSIDE the packaged app. [This adds security registry keys to the service]. (Subinacl.exe is part of the [Windows Server 2003 resource kit].)

subinacl.exe /service "Flexnet licensing service" /grant=Everyone=F

where "Flexnet licensing service" represents the full 'DISPLAY_NAME' of the service. Keep the quotes.

OSD tips

For most things this is a place to quickly alter things to adjust how it works during testing, registry entries etc want to be 'set' in the actual sequencing.

Entries you will need to alter occur under

<?xml version="1.0" standalone="no"?>
<SOFTPKG>

Registry changes

To make registry changes, again under <IMPLEMENTATION><VIRTUALENV><REGISTRY> element. You can use this to override keys back to defaults when application fires up.

  • Note - Don't double backslash paths for the Value, as you would find in a .reg registry file
	<IMPLEMENTATION>
		<VIRTUALENV TERMINATECHILDREN="FALSE">
			<REGISTRY>
				<REGKEY HIVE="HKCU" KEY="Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced">
				<REGVALUE REGTYPE="REG_DWORD" NAME="SeparateProcess">00000001</REGVALUE>
				<REGVALUE REGTYPE="REG_SZ" NAME="filedatalocation">x:\this\is\a\test\</REGVALUE>
			</REGKEY>
			</REGISTRY>

Pre launch script

To launch a script at startup before the actual packaged application starts, set a <DEPENDENCY><SCRIPT><HREF> element under the <SOFTPKG> element.

In this example it is launching a command prompt. This is the most useful tool for debugging!

	<DEPENDENCY>
		<SCRIPT TIMING="PRE" EVENT="LAUNCH" TIMEOUT="0" WAIT="TRUE" PROTECT="TRUE">
			<HREF>cmd.exe</HREF>
		</SCRIPT>
	</DEPENDENCY>


Post launch script

To launch a script at shutdown similarily set a <DEPENDENCY><SCRIPT><HREF> element under the <SOFTPKG> element.

In this examples its stopping a service.

	<DEPENDENCY>
		<SCRIPT TIMING="POST" EVENT="SHUTDOWN" WAIT="TRUE" PROTECT="FALSE">
			<HREF>net stop FontCache3.0.0.0</HREF>
		</SCRIPT>


Child process terminate

Sometimes you need to terminate child processes, I lost my hdd with any examples on :(

The <VIRTUALENV> XML Element can be added under the <IMPLEMENTATION> element thus

	<IMPLEMENTATION>
		<VIRTUALENV TERMINATECHILDREN="TRUE">

Alter local interaction

	<IMPLEMENTATION>
		<POLICIES>
			<LOCAL_INTERACTION_ALLOWED> TRUE </LOCAL_INTERACTION_ALLOWED>
		</POLICIES>

Check path exists

(<HREF doesnt run command interpreter, <SCRIPTBODY does but creates temp bat file somewhere) i.e. <HREF>cmd /c = <SCRIPTBODY>

		<DEPENDENCY>
  			<SCRIPT TIMING="PRE" EVENT="LAUNCH" PROTECT="TRUE" WAIT="TRUE" TIMEOUT="0" ABORTRESULT="1">
					<HREF>cmd /c if not exist "x:\somefolder" exit 1</HREF>
			</SCRIPT>
		</DEPENDENCY>

which is effectively same as

		<DEPENDENCY>
  			<SCRIPT TIMING="PRE" EVENT="LAUNCH" PROTECT="TRUE" WAIT="TRUE" TIMEOUT="10" SUCCESSRESULT="0" ABORTRESULT="1">
					<SCRIPTBODY>if exist "x:\somefolder" (exit 0) else exit 1</SCRIPTBODY>
			</SCRIPT>
		</DEPENDENCY>

Disable virtualised side-by-side assemblies

Forces only using local side-by-side assemblies and not any ones in the virtualised package

	<IMPLEMENTATION>
		<POLICIES>
			<LOCAL_INTERACTION_ALLOWED>FALSE</LOCAL_INTERACTION_ALLOWED>
			<SXS_32_ENABLED>TRUE</SXS_32_ENABLED>
		</POLICIES>

Things that break

  • Programs creating symlinks, so the actual file isnt packaged.

3rd party tools

http://www.tmurgent.com/AppVirt/DeployNPublish.aspx

Update Appv 4.6

No longer need to alter the OSD, just get your actual app name with sftmime

SFTMIME QUERY OBJ:APP /SHORT

Then run sftray with the name

SFTTRAY /EXE cmd.exe /LAUNCH "The Raiser's Edge"

Strange Behaviours

Win7 / 4.6 SP1

  • Disappearance of the Wow6432node key
  • Disappearance of the Classes/CLSID key
  • Regedit, renaming a key by only prefixing with hyphens (in USERS hive anyway) is ignored. e.g. AdobeSVG viewer, renaming the root /Adobe key /-Adobe has no effect.

External Links

http://www.nirsoft.net/utils/reg_file_from_application.html

http://blog.gridmetric.com/2011/09/19/working-with-named-object-virtualization-exclusions/

http://blog.stealthpuppy.com/virtualisation/just-how-do-exclusions-in-app-v-packages-work/

http://blogs.technet.com/b/janelewis/archive/2010/04/30/giving-non-administrators-permission-to-read-event-logs-windows-2003-and-windows-2008.aspx

See Also

Comments

blog comments powered by Disqus