Wednesday, January 27, 2010

TIPS: SQLite: Python: How to get the details of a table

There are two ways you can achieve it.
1.
cursor.execute("PRAGMA table_info(tablename)")
print cursor.fetchall()

2.
sql = sqlite3.connect(self.cFile)
c = sql.cursor()
query = "select * from preferences"
c.execute(query)
col = [tuple[0] for tuple in c.description]
print col

Note:
cur.description returns a tuple of information about each table. The entire tuple is : (name, type_code, display_size, internal_size, precision, scale, null_ok)

Tuesday, January 19, 2010

TIPS: OpenOffice->Impress: How to apply an image to the background of a Presentation


  1. Go to View > Master > Slide Master

  2. Right click on the slide and choose Slide > Set Background Picture for Slide....

  3. Select the desired Image and

  4. Switch off master view.

Friday, January 8, 2010

QA: MSI Interview: What is the difference between installations using ALLUSERS="", ALLUSERS=1 and ALLUSERS=2 option?

Q: What is the difference between installations using ALLUSERS=””, ALLUSERS=1 and ALLUSERS=2 option?

ANS:


  1. ALLUSERS=””: It specifies per-user installation context

  2. ALLUSERS=1: It specifies per-machine installation context

  3. ALLUSERS=2: It enables the system to define the values of ALLUSERS, and in turn the installation context, dependent upon the user’s privileges and the version of Windows




  1. Windows 7: Uses the MSIINSTALLPERUSER property to specify the installation context.



i. MSIINSTALLPERUSER ="": Per-Machine installation.

ii. MSIINSTALLPERUSER =1: Per-User installation


  1. Windows Vista: Windows Installer complies with User Account Control (UAC). If the user has user access privileges, and ALLUSERS=2, the installer performs a per-machine installation only if Admin credentials are provided to the UAC dialog box. If UAC is enabled and the correct Admin credentials are not provided, the installation fails with an error stating that administrator privileges are required. If UAC is disabled by the registry key, group policy, or the control panel, the UAC dialog box is not displayed and the installation fails with an error stating that administrator privileges are required.

  2. Windows XP: Set Windows Installer performs a per-user installation if the user has user access privileges.

  3. Windows 2000: Windows Installer performs a per-machine installation if the user has administrative access privileges on the computer. If the user does not have administrative access privileges, Windows Installer resets the value of the ALLUSERS property to an empty string ("") and performs a per-user installation.

QA: MSI Interview : What are the ADDLOCAL and ADDSOURCE properties?

Q: What are the ADDLOCAL and ADDSOURCE properties?

Ans:


  1. ADDLOCAL:



It is the property which contains the list of features, delimited by commas (,), which are to be installed locally. These features must be present in the Feature column of the Feature Table.


  1. ADDSOURCE:



It is the property which contains the list of features, delimited by commas (,), which are to be installed to run from the Source. These features must be present in the Feature column of the Feature Table.

QA: MSI Interview: Explain the difference between Property and PROPERTY

Q: Explain the difference between Property and PROPERTY

ANS:


  1. Public Property:



Public properties can be changed anytime by a user, system or admin on the command line while installing, by applying a transform or by interacting with the authored user interface (Installation Interface)

They are always in upper case


  1. Private Property:



The installer uses then internally and their values are initialized in the installation database (msi) or set by the values determined by the OS.

They are always in lower case.

Wednesday, January 6, 2010

Few annoying issues with App-V

Few issues or blocks which I found with App-V are as follows:


  1. If two application (say excel 2007 & Excel 2002) have same file type associations (say .xls) then the last one cached gets the file type associations.

  2. If any office application (say excel.exe) is locally installed and is currently running and is in focus then virtual excel will not launch even if the file type association is set for it.

Friday, January 1, 2010

Microsoft Application Virtualization - An Introduction to Sequencing

Microsoft Application Virtualization





Volume – I



An INTRODUCTION

TO SEQUENCING





Mayank Johri







This document is licensed under the Attribution-NonCommercial-ShareAlike 3.0 Unported license, available at http://creativecommons.org/licenses/by-nc-sa/3.0/

Disclaimer

The information in this document is based on publicly available documentations and author's personal & professional experience. In no event shall author be liable for any direct, indirect, consequential, punitive, special or incidental damages (including, without limitation, damages for loss of profits, business interruption or loss of information) arising out of the use or inability to use this document, even if Author has been advised of the possibility of such damages. Author makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to this document at any time without notice. Author does not make any commitment to update the information contained in this document.

Title

Microsoft Application Virtualization - An Introduction to Sequencing

Author

Mayank Johri

Email

johri.maya@gmail.com

Version

2.0.2

Document Date

Friday, January 01, 2010



Credits

This document couldn't have completed without the help of the my family, friends





































































































Table of Contents

Introduction 5

Prerequisites 6

Sequencing 6

Source Files Validation 8

Pre Installation Validation 9

Testing Source Files 10

Validating the Source files 10

Requirements of Application 10

Pre-Sequencing 12

Preparing Sequencing Machine 13

Installing App-V Sequencer 13

Configuring App-V Sequencer 14

Adding Exclusion item 14

Custom Default.sprj 14

Creating Default.sprj 14

Using Text Editor 15

Using App-V Sequencer 15

Sequencing 17

Types of Sequencing 18

MNT Sequencing or Q: Drive Sequencing 18

Benefits 18

Drawbacks 18

VFS Sequencing 18

Benefits 18

Drawbacks 18

Sequencing 18

Configuration Wizard 19

Installation Wizard 20

Shortcut Wizard 21

Sequence Cleanup 22

Publishing and Testing 24

Publishing Application 25

Installing Microsoft App-V Management Console (MAMC) 25

Prerequisites 25

Installation 25

Publishing 25

Testing 26

App-V Server 27

Naming Convention 30



Chapter – 1





Introduction











Contents

Prerequisites 6

Sequencing 6

Application sequencing is the process that takes an off-the-shelf Windows application and prepares it for streaming. This process consists of arranging the application in such a way that the portions of executable code needed first by the end user are put at the beginning of the sequenced file so they are the first to be sent over the network. This includes component files, DLLs and Registry settings. It is important to note that the application is not changed in any way.

Sequencing allows applications to run without installing or altering the host operating system. Application virtualization eliminates the need to test one application against all the others in a production environment for system conflicts, significantly reducing the time it takes to integrate applications. By creating virtualized application packages, they are turned into on-demand services that are centrally administered from single management console.

Virtualized applications can be deployed in real-time and when users need them, instead of having to be installed manually. Users with laptops can even retain these services in a disconnected mode for a predefined amount of time which is normally 45 days if not set by administrator.

Prerequisites

It is assumed that the readers has the basic knowledge of following technologies.

  • Creating Virtual Machines using any of the following OS Virtualization technologies VirtualBox, VMWare Workstation, VMWare Server, Virtual PC or QEMU, etc

  • Installing and patching Windows XP / Vista

  • Installing softwares and MSI Technology

  • Wise Package Studio, ORCA or any other re-packaging tool

Sequencing

Sequencing is the process of virtualizing one or more applications using Microsoft Application Virtualization process. The task of sequencing can be divided into following sections:

  • Naming Conventions

  • Source Files Validation

  • Virtual Machine Setup & App-V Client Installation and Configuration

  • Application Installation & Configuration

  • Shortcuts Configuration

  • Sequence Cleanup

  • App-V Sequence Testing

In chapters to follow we will discuss all the sub-processes in details.

Notes































Chapter 2







Source Files Validation











Contents

Pre Installation Validation 9

Testing Source Files 10

Validating the Source files 10

Requirements of Application 10

One of the most important task while creating any package is to validate the source files and sequencing process is no exception.

It is most important to understand that all applications can not be sequenced and not all applications which can be sequenced should be sequenced. Packager should make the judgment on which applications to sequence. Following list may help in making that decision.

Pre Installation Validation

Selecting an application for sequencing can be tricky task and following tips can be used to make that choice easier.

  1. Device Driver: Microsoft Application Virtualization does not support sequencing of device drivers thus any application which install device driver should not be sequenced


    The application can be sequenced only if the device driver can be installed locally without installing the application. In this case the device driver should be installed locally on the client machines and then the application without the device driver should be sequenced. Device driver then becomes a pre-requisite for the sequence to work on client machines

  2. Application Size : If the maximum client cache size is set for 2 GB (The max can be 64 GB), then the maximum size of application (sft file) which can be streamed on that machine is 2 GB. All applications which have the installed footprint greater then or equal to the max client size, set by the client, should not be sequenced. Also the Max application size App-V can handle is 4GB, [Q: drive has FAT file type and the max file size FAT can handle is 4GB ]. This issue is discussed in more details at http://www.softgridguru.com/viewtopic.php?t=2763

  3. Shortcuts: Application should have minimum of one shortcut. If no shortcuts are present then the application should be sequenced in a suite along with the application which needs it. For example if Macromedia Flash is the application in question to be sequenced then the shortcut should be pointing to the locally installed Internet Explorer

  4. Middleware : Middleware applications are not a good candidate for sequencing as they can be used as a prerequisite by multiple applications, thus should be installed locally. but if multiple version of it are needed then they should be sequenced along with the application which needs them. It is always advised to have only one version of any application/middleware in the organization thus conditions for multiple versions should be avoided

    With Version 4.5 most of the middle-wares can be sequenced and used as secondary packages. See DCS Section for more details

  5. Path hard coding: The application should not have folder/file path hard coding in the application itself. Some application hard code the path of files in registry or ini file or executable. In these cases it has been found that they can be sequenced most of the time using VFS sequencing method, but extreme care should be taken while sequencing & testing these applications. Also Configuration files such as ini, conf, txt, registries etc are good places to look for the hard coding

  6. Base Build Applications: Applications which are already part of base build should not be sequenced. One can sequence them but they are of no real value as they will already be present on the client machines

  7. Auto Update: Application with automatic updates should not be sequenced. Sequenced application most of the time fails to properly update itself. Also allowing auto update leads to non compliance of application version. These types of applications should only be sequenced if the auto update feature can be disabled during sequencing procedure

  8. Services: Services which can be started when application starts and shuts down when application main executable shuts down can be included in sequence. Services that run as their own (like boot-time services do but there are others also) are not suitable for sequencing since under App-V all application starting happens under user’s session context. Special thanks to ksaunam.

    Also applications which installs services which run using specific user credentials can not be sequenced

  9. COM+: Some application which uses COM+ might not work properly in virtual environment, thus this type of applications needs be tested properly

  10. COM DLL: Few application which uses COM DLL surrogate virtualization, i.e. DLL’s that run in Dllhost.exe, does not work properly in App-V Environment. Thus this type of applications needs be tested properly

  11. Licensing Policies: Applications with licensing enforcement tied to machine, e.g. the license is tied to the system’s MAC address, username etc. It should not be sequenced if activation cannot be done by the user at the first launch of sequenced application

  12. Internet Explorer & Service Packs: Internet Explorer, Windows service patches and service packs cannot & should not be sequenced

  13. Network Share Application: It is not a good practice the run applications from network share as they tends to violate the enterprise desktop integrity and thus known to cause integration issues. It is advised to have to entire application inside of App-V package

  14. Hosts file located in “ %windir%\system32\etc” can not be sequenced and should be updated on local machine before the sequenced application is launched

Testing Source Files

Source files should always be tested before actual sequencing is carried out for two reasons

  • To validate the source files installation and test cases

  • To get all the requirements for the installation

Validating the Source files

It always saves time to test the installation of source files on a clean base machine and verify all the test cases without any version of app-v sequencer installed before starting the sequencing.

Requirements of Application

It is very important to accurately collect all the requirements as even one miss might lead to failure in production environment. It is always advised to make a list of all the dependent applications, middle-ware, custom setting required by main application. Evaluate all of them with regards to sequencing, that it makes sense to sequence them or install them locally



Notes






























Chapter – 3









Pre-Sequencing







Contents

Preparing Sequencing Machine 13

Installing App-V Sequencer 13

Configuring App-V Sequencer 14

Adding Exclusion item 14

Custom Default.sprj 14

Creating Default.sprj 14

Using Text Editor 15

Using App-V Sequencer 15



Creating sequencing machine is also a very important task which should not be taken lightly and extreme care should be taken to maintain it. The best policy of creating the sequencing machine is that it should have minimum common denominator softwares which means the applications which are present on every machines sequenced application where it will be streamed to.

Preparing Sequencing Machine

Operating System virtualization is the best way to create sequencing machines. Any of the following OS Virtualization product can be used:

S.No

Virtualization Technology

License/cost

Host OS

Speed

1

QEMU

Free & Open source

Any

Decent with plugins

2

RedHat XEN

Free & Open source

Linux

Good

3

SUN VirtualBox

Free & Open source

Any

Good

4

Microsoft Virtual PC

Free

Microsoft WinXP or latter

Good

5

Vmware Server

Free

Any

Good

6

VMWare Workstation

Not Free & Costly

Any

Good

If virtual machine are not desired then a physical machine can also be used for sequencing.

Sequencing machine (physical or virtual) should have at least the following requirements for normal packaging experience.

Hardware Requirements

1

C Drive

10 GB

2

Q Drive

10 GB

3

RAM

1 – 2 GB

Software Requirements

1

Operating System

Win'XP Pro or Vista

2

Service Pack

Latest or the latest installed on client machines

3

VC Runtime

2005


The above requirements are for sequencing generic applications only and it may change depending upon the application to be sequenced in question

Installing App-V Sequencer

Installing App-V Sequencer is a very simple process. Only two per-requisites are needed for installing it:

  1. VC++ 2005 Runtime

  2. Error Reporting

    Both of them can automatically installed when setup.exe file is used to install the sequencer. Following command can also be used to silently install the sequencer.

    setup.exe /s /v/qn+

It is always advised to create a custom default.sprj file and copy it after the installation is completed.

Configuring App-V Sequencer

Few items should be customized before any sequencing can be started. It is also the best time to add exclusion items such as file, folder and registry key. Also the scratch folder location can be set at this time.

Adding Exclusion item

Defining exclusion items during repacking process is very important task and extreme care should be taken while defining them. There will be situations where one has to remove even the default exclusion items. One such case can be sequencing Google Chrome which gets installed in “%appdata%\Chromium\Application\” and %appdata% is added in default exclusion list, thus It always helps to know the application in advance and where the files gets copied.


The multiple default.sprj files are the best way to deal with various customization based on the application to be sequenced in question. You can create one default.sprj file with no exclusion item and one with maximum possible exclusion etc.

Custom Default.sprj

All the custom exclusions can be added to default.sprj which is stored along with the Sequencer. The custom exclusion list can be created either using any text editor or using the Sequencer itself and I would recommend using the Sequencer to create the custom default.sprj.

Before we can update the default.sprj file it needs to be created by using the following method.

Creating Default.sprj

When Microsoft App-V Sequencer is install then default.sprj file is created and it should be created using the sequencer.

  1. Launch the Sequencer and go to “Tools” “Options” and Select “ Exclusion Items” and select “Set as Default”



  2. Select “Yes” and the default.sprj file is created in installed folder.

Using Text Editor

  1. Open “C:\Program Files\Microsoft Application Virtualization Sequencer” in Windows Explorer

  2. Open default.sprj file using your favorite Text Editor. Notepad++ is my favorite text editor which can be obtained from http://notepad-plus.sourceforge.net website .

  3. Traverse to the end where “ EXCLUSION” tags are present.

  4. Create a new “EXCLUSION” tag and enter the values based on the following tables.

Exclusion Context Value

S.No

Type

Context Value

Meaning

1

File

VFS_EXC

Map to File

2

File/Registry

VFS_BOTH

Map to both Registry and File

3

Registry

VFR_EXC

Map to registry

Exclusion Type Value

S.No

Type Value

Meaning

1

PSR_DataSystem


  1. Save the file and use it.

Using App-V Sequencer

  1. Launch the Sequencer and go to “Tools”→“Options” and click on New


  2. Select “New” and the default.sprj file is created in installed folder.





Notes



Chapter – 4







Sequencing





Contents

Types of Sequencing 18

MNT Sequencing or Q: Drive Sequencing 18

VFS Sequencing 18

Sequencing 18

Configuration Wizard 19

Installation Wizard 20

Shortcut Wizard 21

Sequence Cleanup 22



Now that all the boring stuff is behind us, we can start the actual fun. Actual Sequencing is real fun and most of the time is very simple process.

There is not much differences between MSI setup capture and Sequencing process apart from we try to install everything in Q:\ drive in Sequencing.

Types of Sequencing

There are two ways to sequence any application and are called MNT and VFS Sequencing. They both have some benefits and drawbacks and should be chosen based on your application, but as a thumb rule MNT sequence process should be used and only when it fails then VFS Sequencing method be used.

Now lets go deep in them.

MNT Sequencing or Q: Drive Sequencing

In MNT type , application is installed in Q Drive (mount drive) under mount point folder instead of its default location. Q Drive is the recommended sequencing method and should be used in all cases except DSC Installation and few other cases.

Benefits

  • Sequenced application runs faster then VFS Sequenced application

  • There are more changes of locally and sequenced application to coexist without any issue.

Drawbacks

  • If application install location is hard coded then Q Drive sequencing can not be used

VFS Sequencing

In VFS sequencing the application and its supporting applications are installed in there default location. VFS sequencing is recommended process for sequencing DSC Sequencing.

Benefits

  • Applications with hard-coded path entries can only be sequenced using this method.

  • This is the best solution for sequencing DSC based applications which copy files in sub-folder of base applications.

Drawbacks

  • Sequenced applications run slightly slower then Q Drive based sequence

  • Some applications might not work properly, specially apps which try to evaluate the launch location at the launch time.

Sequencing

  1. Start the sequencing machine.

  2. Stop all the unwanted services such as

  • Windows Update

  • Help and Support

  • Indexing Service

  • Messenger

  • Themes

  • Anti Virus, anti spyware, firewall, etc


Check with your computer security team before disabling any on these. Any one of them should not be disabled until you are sure that these are causing an issue in sequencing the application.

  1. Launch all the shortcuts which are already installed on the machine at least three times


    Shortcuts installed by an MSI install might not work. In that case you will have to launch the executable's which are pointing

  2. Create a dummy ODBC entry, check appendix for details

  3. Create a dummy printer, check appendix for details

  4. Create a folder in Q: drive with name which represent [Package Request Sequence ID].[Revision]: - This folder should be in MSDOS compatible 8.3 format. e.g. 000000212.003 and RCAT3002.002.} This folder name should be always unique



    The folder name can be generated using “Maya Mount Point Generator” which can be downloaded from <XXXXX>. Always read the usage instruction before using it. If more then one person sequence the applications then install it on a network share and periodically take the backup of the database file


    The reason it is needed in 8.3 formats is that all the packages are cached in Q: drive on the client machine and thus there is a change that two folder names will be same upto 6 characters and thus the sequencer client will not be able to identify them properly

  5. Install the sequencer as described in previous chapter

  6. Open the source files location in explorer and if possible copy all the source files in “%temp%\src” folder.

  7. Start the Sequencer and select the “File” -> “ New Package”

Configuration Wizard

Configuration wizard is used to define Sequence name, Mount Point Folder, install & configure the application.

  1. In the package Information Window (Step 1) fill the following information

  • Package Name: Enter the Package Name

  • Comments: Many information can be entered such as sequencing date, sequencer name, packaging details such as source locations, packager name, packaging type etc

Installation Wizard

The Installation wizard is used to install and configure the application(s)

  1. Select the Mount Point Folder

  2. Start the installation of the application once the App-V Sequencer is minimized.

  3. At least start the application three times and close it so that the application should reach in stable status. For VFS Sequencing application should be installed at C:\Program Files\<app folder>, or its default directory where as in Q: Drive Sequencing the application should be installed in a subfolder under mount point folder.

    The reboot request is always captured by App-V sequencer thus if after the installation or during the installation a reboot is required then just stop and restart the monitoring.

  4. Once the installation and configuration is completed, press “Stop Monitoring”.

  5. If any files needs to be added to the sequence then “ Sequencing Wizard: Step 4 of 7” is the last chance to add the files.

Shortcut Wizard

In this section shortcuts & Feature Blocks are configured and on the “Configure Applications” Dialog followings items can be added:

  • Add, Remove & Update Shortcuts

  • Add, Remove & Update File Type Association

  • Add, Remove & Update Shortcut Display Location

  1. Remove all the unwanted shortcuts from the list such as readme.txt, help files, etc.

  2. Set the appropriate version number in the Version section of shortcuts

  3. Change all the shortcuts according to the following way

  • If the package is installed in VFS mode then Change all the C:\Program Files to Q:\<MountPointFolder>\VFS\CSIDL_PROGRAM_FILES

  • Version should not have any characters

  • The OSD File should be like ShortcutName_Version_revision.osd, where ShortcutName will not have any spaces and version will have only digits and no special characters

OSD Helper can be used to update the following automatically, It has a command line utility

  1. Select Next at the launch shortcut wizard

Sequence Cleanup

Once the sequence has been created

  1. Remove any logged in user/computer specific information from Virtual Registry Section

  2. In the Deployment tab update the followings:

  • Protocol

  • HostName

  • Path

  • Operating Systems: Add all Operating Systems in selected section

  1. Save the package by selecting “File”->”Save” and select the folder as C:\temp\<SuiteName> as location and name as <SuiteName>

  2. Copy the saved folder on the content share folder



Chapter – 5









Publishing and Testing







Contents

Publishing Application 25

Installing Microsoft App-V Management Console (MAMC) 25

Testing 26

App-V Server 27

Naming Convention 30



Once the sequence is created and copied to the content share, it needs to be published and tested before it can be published in production environment.

Publishing Application

In order to distribute the sequence to users, it needs to be published on a App-V Server. Applications can be published using Microsoft Application Virtualization Management System (MAVMS)

Installing Microsoft App-V Management Console (MAMC)

MAMC is installed by default on the App-V server and it can be installed as alone application on any machine with WinXP or above.

Prerequisites

Followings components needs to be installed

  • MMC 3.0

  • Framework.NET 2.0

Installation

  • Launch the setup.exe of Server Installation

Publishing

  1. Start the App-V Management console and select Applications and then the group where you want to publish the applicaition.


  2. Right click and then select “New Application Group”


  3. Enter the sequence name in the provided field

  4. Right click on the newly created Application Group and select “Import Applications...”.



  5. Traverse and select the appropriate SPRJ or OSD File.


  6. In the “Import Applications”, Select Enable, select appropriate License Group and Server Group.


  7. Enter the location where the shortcuts should be displayed on the client machines, Default location is under “ Publish to User’s Start Menu” and press Next

  8. If the suite requires any file association then add the file association and press next

  9. Select the appropriate groups and select Next and then Select Next and then Select “Finish”

Testing

Testing sequenced application should include the followings:

  • Streaming on a fresh machine

  • Launching and completing the test cases for admin and non-admin users.

  • Validating the proper working of all the launch scripts if present.

  • Validating the OSD & SPRJ files for the followings Tags

    • WorkingDir: It should not be empty

The Sequencer can test the application using either one the following methods:

App-V Server

App-V Server can be used to stream the application for testing the application.







Naming Convention





Naming Convention

it is always advised to have consistent naming convention for both suite name and OSD files. And in this chapter we will discuss various aspects of it.

Note:

While creating the naming convention it is advised to create a mechanism that will ensure that never will their be a chance for more than one item have the same resultant name