Friday, 24 October 2014

App-V 5.0 : Creating a standalone connection group

Just created a standalone connection group between FireFox, Firebug Add-on and Flash Plugin in a App-V Client machine.

The consolidated steps are as follows.

Step1: For creating a connection group, we would require a new GroupId and Version ID. PowerShell has commands to generate new GUIDs.

PS C:\Users\Administrator> [GUID]::newGUID()

Guid
----
634a961b-1111-46a2-b55e-c566c5b97e5d


PS C:\Users\Administrator> [GUID]::newGUID()

Guid
----
43d5e1b8-2186-4768-9244-7c7e2334e9ee

These GUIDs are used in the myconnectiongroup.xml file at Step3.


Step2: We need to know the Package ID and Version ID of the individual packages for which we are going to create the connection group. Again Powershell...

PS C:\Users\Administrator> set-executionpolicy unrestricted

PS C:\Users\Administrator> import-module appvclient

PS C:\Users\Administrator> Get-AppvClientPackage

The above command will list each App-V packages installed in the client machine, including PackageID and VersionID (used in myconnectiongroup.xml file at Step3). Hence, all the 3 packages mentioned above are needs to be installed in the App-V client machine before executing the Get-AppvClientPackage command.


Step3: Created myconnectiongroup.xml file as below using the each package details (PackageId, VersionId)

<?xml version="1.0" encoding="UTF-8"?>
<appv:AppConnectionGroup
xmlns="http://schemas.microsoft.com/appv/2010/virtualapplicationconnectiongroup"
xmlns:appv="http://schemas.microsoft.com/appv/2010/virtualapplicationconnectiongroup"
AppConnectionGroupId="634a961b-1111-46a2-b55e-c566c5b97e5d"
VersionId="43d5e1b8-2186-4768-9244-7c7e2334e9ee"
Priority="0"
DisplayName="My Connection Group">
<appv:Packages>
<appv:Package
PackageId="e1395e0f-053b-4938-835d-378c5d3d9ee2"
VersionId="bd047c3d-2222-4e46-aba6-734452190e53"
/>
<appv:Package
PackageId="8af0a0cd-8bff-4fea-8bd1-c2825d60fd5d"
VersionId="4ec80509-1234-4c94-835a-f6eaed77771e"
/>
<appv:Package
PackageId="41236dd2-9002-4bbb-a7b5-e7415fbb1b54"
VersionId="1982d093-7896-44a6-aef5-5840c1e2932b"
/>
</appv:Packages>
</appv:AppConnectionGroup>


Step4: Add the connection group in the client machine by executing the below PowerShell command using myconnectiongroup.xml file.

PS C:\Users\Administrator> Add-AppvClientConnectionGroup –path "C:\Users\Administrator\Desktop\myconnectiongroup.xml"


Step5: Before enabling the connection group, we need to publish the individual packages in the App-V client machine. PowerShell commands below.

PS C:\Users\Administrator> Add-AppvClientPackage –path "C:\Users\Administrator\Desktop\MozillaFirefox29.0.001_Package\Mo
zillaFirefox29.0.001_Package.appv" | Publish-AppvClientPackage

PS C:\Users\Administrator> Add-AppvClientPackage –path "C:\Users\Administrator\Desktop\AdobeFlashPlayerPlugin14.0.0.000.
001_Package\AdobeFlashPlayerPlugin14.0.0.000.001_Package.appv" | Publish-AppvClientPackage

PS C:\Users\Administrator> Add-AppvClientPackage –path "C:\Users\Administrator\Desktop\Firebug1.0.1.001_Package\Firebug1
.0.1.001_Package.appv" | Publish-AppvClientPackag

Step6: Enable the connection group by executing the below PowerShell command and by using the connection group display name which was mentioned in the myconnectiongroup.xml file at Step3. In this case, it is "My Connection Group".

PS C:\Users\Administrator> Enable-AppvClientConnectionGroup –name “My Connection Group"

That's it.

Launch the Virtualization Client and check the created connection group in the tab. Launch the FireFox shortcut and check the Add-on along with Flash Plugin.

Content Disclaimer: Use my blog at your own risk. I’m not responsible for your use of the information contained in or linked from these web pages. This information is being given to you gratuitously and there is no agreement or understanding between you and me regarding your use

Tuesday, 14 October 2014

Suppressing UAC prompts for Oracle 11g

We would receive UAC prompts while launching the application shortcuts "Net Configuration Assistant", "Net Manager"  etc. Tried applying various shims using ACT 5.6, but not able fix this UAC prompts.
Also, checked the shortcut behavior using Process Monitor and applied required permission, but that doesn't work.

Found a solution. It may not be the only way, but it worked for me.

The shortcut's compatibility tab can be utilized. Try this manually and check whether the UAC prompts are getting suppressed. If the prompts are suppressed, we can copy these .lnk files, remove the original shortcuts which were put by the application using script and include these .lnk files instead.


Also, try by adding the following registry keys under HKCU and HKLM.

\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

"<Path>\Application.exe"="RunAsInvoker"

Content Disclaimer: Use my blog at your own risk. I’m not responsible for your use of the information contained in or linked from these web pages. This information is being given to you gratuitously and there is no agreement or understanding between you and me regarding your use.

VBScript to Display Progress Messages

I got an application which was installing very silent without any progress messages. But, the customer required some progress message to be displayed to the users. Hence, I wanted to accomplish this requirement somehow. My first choice was AutoIt. But, VBScript is the simple way.

Thought might be useful to others.

Here we go.

Option Explicit

'----------------------------------------------------------------------------------
'Global Script Variables
'----------------------------------------------------------------------------------

Dim strComputer, ObjShell, intTime, strPopUp, iReturn,strMessage,strProcessExe
Dim i,objExplorer,m,strPathLen,strScriptPath, strCmdLine

'----------------------------------------------------------------------------------
'Global Script Constants
'----------------------------------------------------------------------------------

'----------------------------------------------------------------------------------
'variable initialization
'----------------------------------------------------------------------------------
strComputer = "."
Set ObjShell = CreateObject("WScript.Shell")

'----------------------------------------------------------------------------------
'Start of Script (MAIN)
'----------------------------------------------------------------------------------

Set objExplorer = CreateObject _
    ("InternetExplorer.Application")

strPathLen = Len(Wscript.ScriptFullName) - Len(Wscript.ScriptName)
strScriptPath = Left(Wscript.ScriptFullName, strPathLen)

If (Right(strScriptPath, 1) <> "\") Then
strScriptPath = strScriptPath & "\"
End If

objExplorer.Navigate "about:blank"  
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Left = 200
objExplorer.Top = 200
objExplorer.Width = 350
objExplorer.Height = 150
objExplorer.Visible = 1  
objExplorer.Document.Body.Style.Cursor = "wait"
objExplorer.Document.Title = "CRM Outlook"

i = 1
m = 0

strCmdLine = chr(34) & strScriptPath & "application1.exe" & chr(34)
strMessage="Installing application1"
strProcessExe="application1.exe"
iReturn= InstallWithProgressMessage(strCmdLine, strMessage, strProcessExe)

If iReturn = 0 then
strCmdLine = chr(34) & strScriptPath & "application2.exe" & chr(34)
strMessage="Installing application2"
strProcessExe="application2.exe"
iReturn= InstallWithProgressMessage(strCmdLine, strMessage, strProcessExe)
End If

If iReturn = 0 then
strCmdLine = chr(34) & strScriptPath & "application3.exe" & chr(34)
strMessage="Installing application3"
strProcessExe="application3.exe"
iReturn= InstallWithProgressMessage(strCmdLine, strMessage, strProcessExe)
End If

objExplorer.Quit

wscript.quit iReturn

'Functions

'----------------------------------------------------------------------------------
' Function To Check Process Running
'----------------------------------------------------------------------------------
Function IsProcessRunning(strProcess)
On Error Resume Next
Dim ObjWMIService, ObjProcessList, ObjProcess

Set ObjWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set ObjProcessList = ObjWMIService.ExecQuery("Select * from Win32_Process Where Name = '"& strProcess &"'")

For Each ObjProcess In ObjProcessList
IsProcessRunning = True
Exit Function
Next
IsProcessRunning = False
End Function

'----------------------------------------------------------------------------------
' Function To Install with Progress Message
'----------------------------------------------------------------------------------
Function InstallWithProgressMessage(strCmdLine, strMessage, strProcessExe)
InstallWithProgressMessage= objShell.Run(strCmdLine, 0, FALSE)
Do while IsProcessRunning(strProcessExe)
objExplorer.Document.Body.InnerHTML = strMessage & "...<br/><br/>Lapsed Time: " & m & " Mins & " & i & " Seconds</a>"
WScript.Sleep 500
objExplorer.Document.Body.InnerHTML = strMessage & "....<br/><br/>Lapsed Time: " & m & " Mins & " & i & " Seconds</a>"
i = i + 1
If i = 60 Then
m = m + 1
i=0
End If
WScript.Sleep 500
objExplorer.Document.Body.InnerHTML = strMessage & "....<br/><br/>Lapsed Time: " & m & " Mins & " & i & " Seconds</a>"
Loop
End Function

Content Disclaimer: Use my blog at your own risk. I’m not responsible for your use of the information contained in or linked from these web pages. This information is being given to you gratuitously and there is no agreement or understanding between you and me regarding your use.

Friday, 23 May 2014

Implementing PowerShell Commands in the Windows Installer

Create the PowerShell Commands in the .ps1 file.

For Example:
AppV_Client_Settings.ps1


Import-Module appvclient
Add-AppvPublishingServer -Name AppVServer -URL http://abc.local:8001
Set-AppvClientConfiguration -EnablePackageScripts 1

Create a VBScript to execute the .ps1 file using a Custom action.
For Example:
AppVClientConfiguration.vbs

'==========================================================================
'
' DESCRIPTION: To Add App-V client configuration settings using Powershell commands
'
' NAME: AppVClientConfiguration.vbs
'
' AUTHOR: Gnanamani P
'
' AMENDED :
'
' DATE  : 11/12/2013
'
' USAGE: To Add App-V client configuration settings using Powershell commands
'
' PREREQ:
'
' COMMENT: Script should be called in Defferred execution in System context and in 64bit mode
'
'==========================================================================
Option Explicit
Dim objShell, objFSO
Dim strScriptPath, strWindir, ireturn, strCommand1, strCommand2

Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

strScriptPath=objShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%") &"\AppVClientConfig\5.0\"
strWindir = objShell.ExpandEnvironmentStrings("%windir%")


If objFSO.FileExists(strWindir & "\system32\WindowsPowerShell\v1.0\powershell.exe") Then
strCommand1= strWindir & "\system32\WindowsPowerShell\v1.0\powershell.exe set-executionpolicy remotesigned -force"
ireturn = objShell.run(strCommand1,0,True)
If ireturn = 0 then
AddToMsiLog "AppVClient_Config: Powershell RemoteSigned Policy added. Return: " & ireturn
else
AddToMsiLog "AppVClient_Config: Error setting Powershell RemoteSigned Policy. Return: " & ireturn
End if

strCommand2= strWindir & "\system32\WindowsPowerShell\v1.0\powershell.exe –file " & Chr(34) & strScriptPath & "AppV_Client_Settings.ps1" & Chr(34)
ireturn = objShell.run(strCommand2,0,True)
If ireturn = 0 then
AddToMsiLog "AppVClient_Config: AppvClient Module, Client Configuration and Publishing server added. Return: " & ireturn
else
AddToMsiLog "AppVClient_Config: Error setting AppvClient Module, Client Configuration and Publishing server. Return: " & ireturn
End if
Else
AddToMsiLog "Powershell.exe not found in the machine. App-V Client configurations are not added..."
End if

Private Sub AddToMsiLog(strMessage)
Dim objRecord, errMsiMessageTypeInfo
errMsiMessageTypeInfo = &H04000000
Set objRecord = Session.Installer.CreateRecord(1)
objRecord.StringData(1) = strMessage
Session.Message errMsiMessageTypeInfo, objRecord
Set objRecord = Nothing
End Sub


Include the AppV_Client_Settings.ps1 file here "C:\Program Files (x86)\AppVClientConfig\5.0\" in the MSI (for the above VBScript)

Include a Custom Action as below.


Content Disclaimer: Use my blog at your own risk. I’m not responsible for your use of the information contained in or linked from these web pages. This information is being given to you gratuitously and there is no agreement or understanding between you and me regarding your use.

Set a Default Language in InstallShield Setup.ini

When the response file (.iss) is created for the Install Shield setup.exe, the language settings are not getting captured. And the silent installation with the response, always installs the product with the default language which is English in the below screen.


To fix this and change the default language to some other language, the setup.ini file can be utilized.

Original Language Setting in Setup.ini
[Languages]
Default=0x0409
Supported=0x0804,0x0405,0x0406,0x0413,0x0409,0x040c,0x0407,0x0410,0x0412,0x0414,0x0419,0x040a,0x041d,0x041f
RequireExactLangMatch=0x0404,0x0804
RTLLangs=0x0401,0x040d

[0x0409]
0x0409=English (United States)
0x0411=Japanese
0x0401=Arabic (Saudi Arabia)
0x042d=Basque
0x0402=Bulgarian
0x0403=Catalan
0x0804=Chinese (PRC)
0x0404=Chinese (Taiwan)
0x041a=Croatian
0x0405=Czech
0x0406=Danish
0x0413=Dutch (Netherlands)
0x040b=Finnish
0x0c0c=French (Canada)
0x040c=French (France)
0x0407=German (Germany)
0x0408=Greek
0x040d=Hebrew
0x040e=Hungarian
0x0421=Indonesian
0x0410=Italian (Italy)
0x0412=Korean
0x0414=Norwegian (Bokmal)
0x0415=Polish
0x0416=Portuguese (Brazil)
0x0816=Portuguese (Portugal)
0x0418=Romanian
0x0419=Russian
0x0c1a=Serbian (Cyrillic)
0x041b=Slovak
0x0424=Slovenian
0x040a=Spanish (Traditional Sort)
0x041d=Swedish
0x041e=Thai
0x041f=Turkish

Modified Setup.ini for French
[Languages]
Default=0x040c
Supported=0x040c
RequireExactLangMatch=0x040c
RTLLangs=0x040c

[0x040c]
0x040c=French (France)

Content Disclaimer: Use my blog at your own risk. I’m not responsible for your use of the information contained in or linked from these web pages. This information is being given to you gratuitously and there is no agreement or understanding between you and me regarding your use.

Tuesday, 29 April 2014

Uninstall Microsoft Office without MSOCache or Source location

The following command line can be utilized to uninstall the Microsoft Office application without the need of MSO Cache or Original Source Setup.

Language Pack
%CommonProgramFiles%\microsoft shared\OFFICE14\Office Setup Controller\Setup.exe /uninstall OMUI.nl-nl /config <Path>\config.xml

Proofing Toolkit
%CommonProgramFiles%\microsoft shared\OFFICE14\Office Setup Controller\Setup.exe /uninstall ProofKit /config <Path>\config.xml

Office
%CommonProgramFiles%\microsoft shared\OFFICE14\Office Setup Controller\Setup.exe /uninstall ProPlus /config <Path>\config.xml


Content Disclaimer: Use my blog at your own risk. I’m not responsible for your use of the information contained in or linked from these web pages. This information is being given to you gratuitously and there is no agreement or understanding between you and me regarding your use.