Pages

Wednesday, 20 June 2012

Disadvantages of SelfReg Table Entries

• Rollback of an installation with self-registered modules cannot be safely done using DllUnregisterServer because there is no way of telling if the self-registered keys are used by another feature or application.
• The ability to use advertisement is reduced if Class or extension server registration is performed within self-registration routines.
• The installer automatically handles HKCR keys in the registry tables for both per-user or per-machine installations. DllRegisterServer routines currently do not support the notion of a per-user HKCR key.
• If multiple users are using a self-registered application on the same computer, each user must install the application the first time they run it. Otherwise the installer cannot easily determine that the proper HKCU registry keys exist.
• The DllRegisterServer can be denied access to network resources such as type libraries if a component is both specified as run-from-source and is listed in the SelfReg table. This can cause the installation of the component to fail to during an administrative installation.
• Self-registering DLLs are more susceptible to coding errors because the new code required for DllRegisterServer is commonly different for each DLL. Instead use the registry tables in the database to take advantage of existing code provided by the installer.
• Self-registering DLLs can sometimes link to auxiliary DLLs that are not present or are the wrong version. In contrast, the installer can register the DLLs using the registry tables with no dependency on the current state of the system.

VBScript to Display Countdown Timer

Following script displays countdown timer



Dim counter
Dim oShell
counter = 10
Set oShell= CreateObject("Wscript.Shell")
While counter > 0


oShell.Popup " Left " & counter & " Seconds",1,"Remind"
counter = counter-1
Wend

What is application packaging


Tuesday, 19 June 2012

Set Shortcut Working Directory - VBScript

Following script checks for Windows XP or Windows7 and sets working directory accodingly.


'Option Explicit


Dim objShell, ALLUSERSPROFILE, SysDrive, objShtCut


Set objShell = WScript.CreateObject("WScript.Shell")
ALLUSERSPROFILE =objShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")
APPDATA =objShell.ExpandEnvironmentStrings("%APPDATA%")




strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")


Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")


For Each objOperatingSystem in colOperatingSystems
    ver= objOperatingSystem.Caption 
Next


S = InStr(ver,"XP")




If S > 0 Then


Set objShtCut = objShell.Createshortcut(ALLUSERSPROFILE &"\Start Menu\Programs\SampleTest.lnk")
objShtCut.WorkingDirectory = APPDATA & "\Sample"

objShtCut.Save


else


Set objShtCut = objShell.Createshortcut(ALLUSERSPROFILE &"\Microsoft\Windows\Start Menu\Programs\SampleTest.lnk")
objShtCut.WorkingDirectory = APPDATA & "\Sample"
objShtCut.Save


end if
WScript.Quit

Set Default Printer + VBScript

Use following script to set default printer




On Error Resume Next
Const HKCU = &H80000001
dim osh, var
dim regval, Sh, keyname
Dim objReg
Dim strcomputer


strcomputer="."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")


strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows"


objReg.EnumValues HKCU, strKeyPath, arrSubKeys, arTypes
var="0"
For Each subkey In arrSubKeys
keyname = strkeypath & "\" & subkey
if (keyname = strkeypath & "\" & "Device") then
var="1" 
end If
Next

if var="0" then
objReg.SetStringValue HKCU, strKeyPath, "Device", "FACSys Fax Printer,winspool,Ne00:"
end if


Set oSH = nothing

Application Packaging Training - July 2012 Batch

Application Packaging Training new batch is scheduled to start on 30th June 2012. For further visit www.apprepack.in or contact me on Arjun@Apprepack.in

Application Packaging Training - July 2012 Batch


New batch of Application Packaging Training starting from 30th June 2012.

Duration: 1 Month

Interested candidates can visit www.apprepack.in for more information or email us on contact@apprepack.in 


-> We also deliver training on Microsoft App-V, SCCM 2007, AdminStudio, Installshield, Wise Package Studio