Results 1 to 5 of 5

Thread: UNINSTALL_STRING equivalent in basic project?

  1. #1
    Join Date
    Sep 2002
    Location
    1060 West Addison - Chicago
    Posts
    221

    UNINSTALL_STRING equivalent in basic project?

    << Dev 7.04 basic project >>

    In a basic project is there an equivalent to UNINSTALL_STRING?

    Or do I need to create a IS?

  2. #2
    Join Date
    Oct 2001
    Location
    Here and there
    Posts
    16,233
    If you just want to know the uninstall command, it's something like msiexec /x [ProductCode]; I gather the Add/Remove Programs panel automatically handles the command line, so as far as I know you can't change what happens (for example) when the user clicks the Remove button in Add/Remove Programs.

  3. #3
    Join Date
    Sep 2002
    Location
    1060 West Addison - Chicago
    Posts
    221
    I was searching for a way to check if "Remove" was selected from the MaintenanceType screen. I have an app that installs a "child" application (written in IS 6.11), the problem is that when the setup goes to Maintenance mode, the child Uninstallation is started (via an IS).

    I fixed it like this:
    created a property APPUNINST=86
    IS:
    function OnBegin( )
    NUMBER nBuffer,nReturn; STRING sProd,sVal;
    begin
    nBuffer = MAX_PATH + 1;
    MsiGetProperty (ISMSI_HANDLE,"SUITEUNINST",sVal,nBuffer);
    MsiGetProperty (ISMSI_HANDLE,"ProductName",sProd,nBuffer);
    RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
    nReturn = RegDBKeyExist("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"^PRODUCT_GUID);
    if (!MAINTENANCE)then
    if (nReturn =1) then; //exists
    if (sVal != "86") then
    MessageBox(sProd + " is already installed.\nPlease uninstall from Add /Remove programs before reinstalling.\n\nAborting...",SEVERE);
    abort
    else
    //not exists
    endif;
    endif;
    endif;
    end;

    It seems to work pretty well. What it does is if the setup was run again the OnBegin will give them a message to uninstall instead of going into maintenance. I do not think I need the first IF statement.

    Do you foresee any problems with this?

  4. #4
    Join Date
    Oct 2001
    Location
    Here and there
    Posts
    16,233
    (As an aside, in the future you might use the [code]...[/code] format when displaying source code in a post; makes it easier to read.)

    I'm not sure I follow what the code is doing: where is the APPUNINST property being set? Could you just check the return value of SdWelcomeMaint in OnMaintUIBefore? Is this an InstallScript project?

    (And a general code comment: you might want to re-initialize nBuffer between the two calls to MsiGetProperty...)

  5. #5
    Join Date
    Sep 2002
    Location
    1060 West Addison - Chicago
    Posts
    221
    This is a Basic project. APPUNINST is set via the command line (/v"APPUNINST=0" and in setup.ini's "CmdLine=").

    Thank you for the code tip!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •