Posts

Installshield Build Error Code 0

I was facing this issue with Installshield 2012 SP1. I had installed this product with AdminStudio 11. When I converted the MSI to .ism project through Installshield and then tried to build it back to MSI, I always got this error code 0. I could not find any documentation for this online so wrote back to Installshield Customer Support and they came up with this work around. Hope this will help you if you are facing this similar issue with your product. Do let me know by commenting if this has helped you. Just want to know how many people are affected by this, Within the .ism project: Go to the Direct Editor under the Additional Tools section. Select the InstallShield table. Change the SchemaVersion property from 772 to 771. Save, close, and reopen the project. InstallShield will prompt asking if you want to upgrade the project. Click Yes to upgrade the project. You should now be able to build the project without error. Apprantly this is the issue with this release of th...

VBScript to Determine 32-bit or 64-bit machine

Often we come across a situation where we need to see the Operating system bit information and then install application or do any customization. Here is a script which I use for this purpose: '=============================================================== Const HKEY_LOCAL_MACHINE = &H80000002 'Lines to get the computer Name Set wshShell = WScript.CreateObject( "WScript.Shell" ) strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )   '=============================================================== 'To check whether the OS is 32 bit or 64 bit of Windows 7 '=============================================================== 'Lines to detect whether the OS is 32 bit or 64 bit of Windows 7 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputerName & "\root\default:StdRegProv")   strKeyPath = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"   strValueName = ...

VBScript to determine Root Drive

As per best practices we should not hard code the Root Drive in our package. If your package goes to multiple machines having different Root Drives, then you can use this simple VBScript in your package as Custom Action and it will set the Root Drive automatically for that machine. This script picks up the Root Drive from where Program Files folder is installed. Set oshell=CreateObject("Wscript.shell") prog=oshell.ExpandEnvironmentStrings("%ProgramFiles%") vletter=Split(prog,":") dletter=vletter(0) & ":\" session.property("ROOTDRIVE")=dletter

Installation and Uninstallation of MSU in silent mode

MSU are the Microsoft Update files. You can easily install the MSU file silently without reboot with the following command line: wusa.exe Windows6.1-KB123456-x86.msu /quiet /norestart To Uninstall it Silently you need to follow this simple procedure: 1) Run this command: expand c:\temp\Windows6.0-KB123456-x86.msu –F:Windows6.0-KB123456-x86.xml c:\temp 2) This will create an XML file in temp folder as per the name above. Edit this xml in notepad. 3)Find the assemblyidentity tag. Then, note the values of the following attributes: The name attribute The publickeytoken attribute The processArchitecture attribute The version attribute 4) Use the below command to uninstall the MSU from your machine. start /w pkgmgr /up: name ~ publickeytoken ~ processArchitecture ~~ version Note: The variables above need to be replaced by the vaules you have copied in step 3.

VBScript to copy file and Powershell Script to copy file

VBScript to copy file: dim filesys, oShell Set filesys = CreateObject("Scripting.FileSystemObject") Set oShell = CreateObject("WScript.Shell") sup = oShell.ExpandEnvironmentStrings ("%APPDATA%") des = oShell.ExpandEnvironmentStrings ("%ProgramFiles(x86)%") destfile= sup & "\AR System\HOME\AR" sourcefile= des & "\AR System\User\AR" If filesys.FileExists(sourcefile) Then    filesys.CopyFile sourcefile, destfile End If Powershell Script to copy file: $SourceFile = "c:\foo\Test.txt";  $NewFile    = "c:\foo\Test2.txt";    # Now - check to see if $Sourcefile exists, and if so,  # copy it to $newfile   if ([System.IO.File]::Exists($SourceFile))  {     [System.IO.File]::Copy($SourceFile, $NewFile)     "Source File ($SourceFile) copied to ($newFile)"  }  else {  "Source file ($Sourcefile) does not exist."  }

Creating a SendTo Shortcut through MSI

If you want to create a SendTo shortcut through MSI, then if you just add the shortcut in MSI in SendTo folder, it will not work. Even if you get the shortcut there in every user profile, still it will not work. To make a SendTo shortcut, you need to create it on the fly, which means that shortcut should be created from original exe. To solve this issue for one of my application, WinSCP, I wrote the below VBScript and placed it in %ALLUSERPROFILE%\WinSCP folder. Then I created an Active setup to call this VBScript. Set Shell = CreateObject("WScript.Shell") ShortcutPath = Shell.SpecialFolders("SendTo") Set link = Shell.CreateShortcut(ShortcutPath & "\WinSCP (for upload).lnk") link.Arguments = "/upload" link.Description = "WinScp" link.HotKey = "" link.IconLocation = "C:\Program Files (x86)\WinSCP\WinSCP.exe,0" link.TargetPath = "C:\Program Files (x86)\WinSCP\WinSCP.exe" link.WindowStyle = 3 link.WorkingD...

VBScript to Kill a Process

This worked great for me. Just use as function and kill as many processes as you like. KillProc "abc.exe" Sub KillProc( myProcess )     Dim blnRunning, colProcesses, objProcess     blnRunning = False     Set colProcesses = GetObject( _                        "winmgmts:{impersonationLevel=impersonate}" _                        ).ExecQuery( "Select * From Win32_Process", , 48 )     For Each objProcess in colProcesses         If LCase( myProcess ) = LCase( objProcess.Name ) Then             ' Confirm that the process was actually running             blnRunning = True ...