Tuesday, September 14, 2010

Creating an Uninstall Shortcut for an InstallScript MSI Project

Hi All, Today I need to share how we can create shortcuts in our installshield projects for uninstalling existing installed product. When we use the below information, we were able to install a shortcut along with our application. This shortcut will trigger the uninstallation process.

A Basic MSI installation package can be uninstalled using this command line:
[SystemFolder]Msiexec.exe /x{PRODUCT_CODE}

However, using the same command line for an InstallScript MSI will not uninstall some registry entries, nor would the entry in the Add/Remove Programs applet be removed. This article explains the proper command line to execute the uninstall for an InstallScript MSI project via a shortcut.



Discussion:
InstallShield 12 and newer
Uninstall shortcuts for InstallScript MSI projects are launched through a cached version of the setup.exe. This file is cached in the InstallShield Installation Information folder when the installation has completed. Below are the steps to add a shortcut to launch the cached setup.exe for an uninstall shortcut:


1. Browse to the Shortcuts view or the Shortcuts view of a component.
2. Right-click the desired folder location for the shortcut and select New Shortcut to Preexisting File.
3. In the Browse for Shortcut Target dialog, select the [ProgramFilesFolder] folder. Click OK. Name the shortcut created.
4. Fill in the Target field for the new shortcut as follows:
[ProgramFilesFolder]InstallShield Installation Information\[ProductCode]\setup.exe
Note: Quotes are not required for the shortcut target, they will automatically be placed around the filename and path by Windows Installer at runtime. [ProductCode] will also be replaced at runtime with the Product Code of the MSI package being installed.
5. Fill in the Arguments field for the shortcut as follows:
/runfromtemp /x

For InstallShield 11.5 and earlier
When adding an uninstallation shortcut for an InstallScript MSI project, the file that would be launched is IDriver.exe rather than Msiexec.exe. IDriver.exe is installed automatically, and there is no need to manually install this file. Below are the steps to add a shortcut to launch IDriver and uninstall the InstallScript MSI project:


1. Browse to the Shortcuts view or the Shortcuts view of a component.
2. Right-click and select New Shortcut to Preexisting File.
3. In the Browse for Shortcut Target dialog, the directories that will point to 
    Idriver.exe should be made. The subfolders InstallShield\Driver\ x \Intel 32
    should be added under the [CommonFilesFolder]. The x is where the
    appropriate version of IDriver.exe should be indicated; that being a 7 or 8
    for Developer 7 or 8 projects respectively, or 9 or 10 for DevStudio 9 or X
    projects respectively.

4. Fill in the Arguments field as follows:
    
Arguments: /M{Product Code}
    
{Product Code} would be replaced with your actual product code. It might
    look similar to the following:

    Arguments: /M{7C071035-F334-11D5-818A-00C04F288311}


To find the Product Code for a particular project, follow these steps:
1. Open project in the InstallShield IDE.
2. Select the General Information view.
3. Select Product Properties.
4. Note the value of the Product Code field in the right panel

Friday, August 6, 2010

Problem in changing Logon Credentials of service

Hi, often in our installer products we need to install windows service. Sometimes requirement is such that user need to give input to the installer that whether he needs to install the services on behalf of 'Local Account' or custom user account.

There is no issue till we use 'Local Account' for running the services. But the moment we go for custom account, issues start coming on different machines regarding login credentials failure for the installed services.

For this scenario, there is an easy way-out. :)

Please note that service user we are going to use for services should have Log on as a service right. To perform these, there are some simple steps to follow:


Following are the steps to check
1. Start - Run - secpol.msc
2. Local Policies - User Rights Assignment - Log on as a service


Add User to it. And have fun with your services. :)

Issue in browsing User in SdLogonUser dialog

Hi, sometimes I faced issues in using inbuilt dialog "SdLogonUser" functionality in Installshield. Issues were like on clicking the Browse button for user, nothing happens. I was not able to browse the user. 
One of my senior sorted out this issue by doing a lot of R&D on web. Atlast we got some solution which is stated below:


Check if Computer Browsing service is enabled.
*****************************************************
TroubleShooting:
Method 1: Enable NetBIOS over TCP/IP and start the Computer Browser service
To resolve this issue, make sure that NetBIOS over TCP/IP is turned on and that the Computer Browser service is running on each computer in the workgroup. To do this, follow these steps.
Step 1: Enable NetBIOS over TCP/IP


1. Click Start, click Control Panel, and then click Network and Internet Connections.
2. Click Network Connections.
3. Right-click Local Area Connection, and then click Properties.
4. Click Internet Protocol (TCP/IP), and then click Properties.
5. Click the General tab, and then click Advanced.
6. Click the WINS tab.
7. Under NetBIOS setting, click Enable NetBIOS over TCP/IP, and then click OK two times.
8. Click Close to close the Local Area Connection Properties dialog box.
9. Close the Network Connections window.


Step 2: Start the Computer Browser service


1. Click Start, right-click My Computer, and then click Manage.
2. Double-click Services and Applications.
3. Double-click Services.
4. On the right side, right-click Computer Browser, and then click Start.
5. Close the Computer Management window.


Back to the top:
Method 2: Install File and Print Sharing and make sure that it is not blocked by Windows Firewall
Step 1: Install File and Print Sharing for Microsoft Networks


1. Click Start, click Run, type ncpa.cpl, and then click OK.
2. Right-click Local Area Connection, and then click Properties.
3. Click the General tab, and then click Install.
4. Click Service, and then click Add.
5. In the Network Service list, click File and Print Sharing for Microsoft Networks, and then click OK.
6. Click Close.


Step 2: Make sure that File and Printer Sharing is not blocked by Windows Firewall


1. Click Start, click Run, type firewall.cpl, and then click OK.
2. On the General tab, make sure that the Don't allow exceptions check box is not selected.
3. Click the Exceptions tab.
4. On the Exceptions tab, make sure that the File and Printer Sharing check box is selected, and then click OK.