PDA

View Full Version : serious problem!!



sappu17
06-30-2005, 03:26 PM
I have been tryng to solve this problem since 3 weeks but nothing seems to work.

Problem: I need to remove previous installations of my software from target machine.

Solution: I figured out a way to get the 'UNINSTALL STRING' from the registry.

1. I use AppSearch and search my 'PRODUCT NAME' and from that I want to get the uninstall string. My product name is generally stored in a key named, "Display Name", if there are existing versions of my product, it should go there on AppSearch and from that name, I need a way of pulling the uninstall string.

2. Then, after I get it, how and where to do I run the uninstall string ? My idea is that it should be the first action to run it after it detects the previous verison on my new install. But, how do I add it to the command line using the Custom Actions?

3. Secondly, Do we need to turn on the maintanence mode when its running the uninstall string??
My problem is that my setup.exe is a SINGLE EXECUTABLE, which doesnt tell me where it installs the .msi file on target.

Daniel K
07-01-2005, 05:58 AM
Hi, funnily enough I've had to tackle this myself recently...

Is the previous product an MSI install? If so then why not just author a Major Upgrade in the Upgrade table? Or just use:

MsiConfigureProductExA(svGUID, nNull, INSTALLSTATE_ABSENT, szCmdLine); from an Installscript CA.

NB (you'll need to define it first - prototype MSI.MsiConfigureProductExA(BYVAL STRING, BYVAL NUMBER, BYVAL NUMBER, BYVAL STRING); )

If it isn't MSI then the try running your install string using the following function:

//FUNCTION: RunCommandLine()
//PURPOSE: Passes and runs a command line using the command console
//EVENT: Called from script
//PARAMETERS: Pass command line you wish to run using command console

prototype RunCommandLine(STRING);
function RunCommandLine(svCommandLine)
NUMBER nvResult;
STRING svResult, svCommandEXE, svConsolePath;
STRING svReturnString;
begin
GetSystemInfo(OS, nvResult, svResult);
if(nvResult = IS_WINDOWSNT)then
if(FindFile(WINSYSDIR, "cmd.exe", svResult)<0)then//check file exists
return FALSE;
else
svCommandEXE = "cmd.exe"; //set file name
endif;
elseif(nvResult = IS_WINDOWS9X)then
if(FindFile(WINSYSDIR, "command.exe", svResult)<0)then//check file exists
return FALSE;
else
svCommandEXE = "command.exe";//set files name
endif;
else
return FALSE;
endif;
//now we know the name of the command console
svCommandLine = " /c "+svCommandLine; //format command line
svConsolePath = WINSYSDIR^svCommandEXE;
LongPathToShortPath(svConsolePath);

if(LaunchAppAndWait(svConsolePath, svCommandLine, WAIT)<0)then
MessageBox(@ERR_CANNOT_UNINSTALL, SEVERE);
abort;
endif;
end;

sappu17
07-01-2005, 01:52 PM
When you say 'MSIInstall', do you mean that its manually run using .msi file?
In my case, I used a setup.exe which is a SINGLE executable which includes the msi with it.

So, all I do is run the setup.exe and it creates an .msi file somewhere in a temp directory on my system and installs all the files.

I have to get hold of those msi files created by the previous installs.

Daniel K
07-04-2005, 03:40 AM
I'm not quite with you; but I think you are saying that the old installs are .msi and so is the current install. If this is the case you can simply author a major upgrade in the 'Upgrade' view. You should be able to find what you need to know in the documentation.

newuser2003
07-19-2005, 10:44 AM
Did you find the solution? I had this problem with the DevStudio. And we just purchased IS11. Unfortunately, for me Major ugrade does not work because I need to uninstall ANY version of the product before install a new one. It could be newer version over older one or vice versa. The user wants to run silent installation.
Thank you in advance

SGorman
07-20-2005, 09:21 AM
newuser? Can't you do someothing like create a Major Upgrade item for a range of versions from 0 to thisVersion - 1, then create another Major Upgrade item for a range of versions from thisVersion to some large number (not inclusive).

That should cause it to treat any older version and any newer version as a major upgrade.

(I haven't tried this, but it sounds like it would work.)

newuser2003
07-22-2005, 11:00 AM
Thank you, I am testing it now. Maybe, you know this one...
I am trying to use ProductVersion property to set up VersionMax and VersionMin in my upgrades but it does not work out.
What is the proper syntax for using? I tried [ProductVersion] and {ProductVersion}.
Thank you

newuser2003
07-27-2005, 03:13 PM
I actually tried to use two major upgrades and it seems to work with one exception ( there is always something with the IS). It does not work for the same version. Even though I included version number in an upgrade it does not work properly. The silent install runs uninstall script but never deletes and copies files as a new installation, therefore the installation corrupts.
Any thoughts? Again, I am trying to run silent install on top of a previous install. Also , if I try to install the same version, but different build it does not uninstall application but gives me a massage "Another version of this product....." asking me for a manual uninstall.
Still struggling...