Pages

Friday, 8 June 2012

Difference between Run Runonce and ActiveSetup


Active Setup:
It is used when your application requires installation of components such as files or registry keys on a per-user basis, but application has no advertised entry points or other triggers to initiate the installation process.
Run:
The Run key is processed after every logon, either by the Explorer shell, if it is present, or by First Boot Agent (FBA), if a custom shell, Command shell, or Task Manager Shell is used. If FBA processes this key, it does so after every logon, not during first boot as it normally would. Typically, this flag is used to load Systray applications, launch services in executables, hide autostart applications, or hide background processes
Run Once:
The RunOnce key is processed only once, by FBA, after Plug and Play device enumeration and DLL registration processing have completed. The values of this registry key are deleted from the registry after it is processed, so that it will not run again. Typically, this flag is used when a reboot is required, such as for a DLL or OCX registration, or for cleaning up a setup or an uninstall.

What is ALLUSERS=1

ALLUSERS =1   -> Per machine installation
ALLUSERS=0    -> Per User Installation, application will be installed only to user who is installing application
ALLUSERS=2    -> Depending upon user rights application will be installed.

                                If the user is Administrator then app will be installed as ALLUSERS=1
                                If the user is non-admin then app will be installed as ALLUSERS=2

Different GUIDs present in MSI

ProductCode
PackageCode
ComponentCode
UpgradeCode

Why multiple MSIExec.exe processes run during an installation?

A number of MSIExec processes can be running during an installation. The reason for this is that Windows Installer uses a client-server model for performing installations. Additionally for security reasons, Windows Installer hosts DLL and script custom actions in a “sandbox” process. Depending on how the install was initiated, one of the MSIExec processes can be the client process. Another MSIExec process is Windows Installer service. Any remaining MSIExec processes are usually sandbox processes for hosting custom actions. The determination as to which MSIExec process will serve as the sandbox process for a script or DLL custom action depends in part on whether the custom action will run elevated or impersonated and whether the custom action is 32-bit or 64-bit.

Suppress reboot in WiseScript

Set Variable RESTART to NULL (dont give any value and its considered as NULL)

VBScript to Delete User folders or files on Windows 7

Following script deletes folder by searching each user profile on windows7





Dim FSfolder 
Dim subfolder 
Dim i 


set objshell = CreateObject("Wscript.shell") 
Set FSO = CreateObject("Scripting.FileSystemObject")
Profile = strSysDrive & "C:\Users"
Set FSfolder = FSO.GetFolder(Profile) 'getting the user profile folders




'starting of the loop to delete the HKCUs


For Each subfolder In FSfolder.SubFolders


   If (subfolder.Name <> "All Users" And  subfolder.Name <> "Default User"_
   and subfolder.Name <> "LocalService" and subfolder.Name <> "NetworkService") Then


folder1=Profile & "\" & subfolder.Name & "\AppData\Local\TechSmith\Snagit"




DeleteThisFolder(folder1)




   end if


Next 


'*******************************************************************************************************


Function DeleteThisFolder(FolderName)


    If FSO.FolderExists(FolderName) Then
    objshell.Run "CMD.EXE /C RD /S /Q """ & FolderName & """",0,True 
    End If


End Function

How do disable a feature in MSI

In Feature Table, Goto Level of the particular feature which as to be disabled and  set it to 0

Another way to disable feature is set the feature level to above the value of INSTALLEVEL property value.

If INSTALLLEVEL property value is 100, then feature level has to be any value above 100.