Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

LaunchAppEx


4 replies to this topic

davestiff

davestiff
  • Members
  • 1 posts

Posted 22 July 2002 - 15:34

Windows 2000 Professional SP2
InstallShield Professional 6.30

I have created a setup which removes a previous version of the software. It removes the previous version using a silent uninstall. Both versions are created using IS 6.30.

The problem is that the setup does not wait until the silent uninstall is complete. This causes problems because both installs use the same registry and HD location. They interfere with each other.

I have tried using the LaunchAppEx from installsite.org but it still does not wait. I cannot check the silent uninstall log in a loop for the ResponseResult because it is zero immediately when the file is created.

I may have to hard code a delay unless someone has another suggestion for me.

Thanks,
David Stiff
Trango Software - a SIEMENS company

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 22 July 2002 - 17:00

Humm, I've not been very successful with getting a silent uninstall to truly be silent.  Although I have had similar problems with silent installations.

However, in such cases, I've not found the ResponseResult to immediately be zero.  Instead the setup.log file exists, but the ResponseResult line item has not yet been entered.  Thereby causing my checks to fail and causing me to bring up the regular install and say that the user will need to manually run through it.

To help combat all this, I currently have a retry count of 1 with a 30 second timeout inbetween each attempt.  As a result, it looks for the entry, waits 30 seconds, looks again, and if it still doesn't exist, behaves as previously mentioned.

Unfortunately I'm not aware of a more elegant solution to this problem as the time it takes to write all this information varies depending on the system (i.e. CPU speed, amount of RAM, etc.).

Hope it helps.
user posted image

prozacrefugee

prozacrefugee
  • Members
  • 38 posts

Posted 23 August 2002 - 21:28

The way that has worked the best for me is:
   DoInstall ( SRCDIR^"Tomcat"^"Setup.inx" , "/s" , WAIT );
if you are using another IS script, or

LaunchAppAndWait (szCommand, szParam , WAIT );
if you are using another type of setup or application

BTW- there is a manual pause available in IS, call it like:
Delay(10);

Hope this helps!

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 23 August 2002 - 22:35

prozacrefugee: I'm not sure if this response is directed towards me or davestiff, but either way I don't think they are at all helpful.  Sorry!

Also, the Delay call is what I use for the timeouts, but they are cheesy and far from perfect solutions.

---

davestiff: Is the initial ResponseResult entry by chance actually just a leftover from the original installation?  To test this theory, you could delete it and see if the problem goes away.  If so, just add that line of code to your InstallScript.


user posted image

tycoates

tycoates
  • Members
  • 8 posts

Posted 24 August 2002 - 05:33

Try this:

  //look for previous version
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\InstallShield_{A37BA37F-9BD1-4474-B180-B89F83F5DD0A}";
szName ="UninstallString";
nResult = RegDBGetKeyValueEx ( szKey , szName , nvType, svValue , nvSize );
if (nResult < 0) then
SWDist_WriteLOG("Could not read the registry to see if previous version is installed.");
else
SWDist_WriteLOG("Previous version is found, will call uninstall...");
Uninstall_Prev_Version();
endif;



If you have previous version or same version already installed then call Uninstall_Prev_Version()

This will parse the uninstall string... and then call it.. and wait for it to end.


RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\InstallShield_{A37BA37F-9BD1-4474-B180-B89F83F5DD0A}";
szName ="UninstallString";
RegDBGetKeyValueEx ( szKey , szName , nvType, svValue , nvSize );
//MessageBox (svValue, INFORMATION);                        
                       
//Parse svValue returned from Reg to get command and parameter
   nListID = ListCreate(STRINGLIST);
   StrGetTokens( nListID ,  svValue , " " ); //Use space as the token
   ListGetFirstString(nListID, svCmd);
   while( ListGetNextString (nListID, svParm2) == 0 )
    svParm = svParm + " " + svParm2;                
endwhile;                            
SWDist_WriteLOG("The cmd: " + svCmd);  
//MessageBox (svCmd, INFORMATION);
SWDist_WriteLOG("The parms: " + svParm);
//MessageBox (svParm, INFORMATION);
                                   
   //Call uninstall
nResult = LaunchAppAndWait( svCmd , "-y -a" + svParm, WAIT );
//MessageBox (svCmd + " " + svParm, INFORMATION);
SWDist_WriteLOG("The final parm: " + svParm);
if( nResult < 0 ) then
SWDist_WriteLOG("Call to Uninstall failed...");
SWDist_Terminate(nResult, "");
endif;

Hope this helps... the LaunchAppAndWait will launch the app and the -y and -a switches will answer any questions about uninstalling any DLL's that are shared.