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

Path when re-running install


5 replies to this topic

mcpost

mcpost
  • Members
  • 7 posts

Posted 19 September 2005 - 21:37

Hi,

I have setup an InstallScript MSI project (Installshield v.11) to always re-install if there is already an existing install. In OnMaintUIBefore(), I call FeatureReinstall(). When running the setup the second time, I get the following message:

"Setup could not find a file on the specified path or disk.

Please check that proper disk is inserted or speicfy new path.

Unable to locate file c:\DOCUME~1\<my username>\LOCALS~1\Temp\_is7340\My Long Product Name With Space.msi"

I checked the path and the file, and they are all correct. I notice the long paths are converted to short path except for the filename. Is this the reason why it couldn't find the file? What can I do to convert it to short path name prior to calling reinstall?

Thanks!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 20 September 2005 - 07:37

The short paths shouldn't be a problem.
While the error message is on the screen, can you enter that path in an Explorer Window and see if the file can really be found at that exact location (using the short paths) at that time? Maybe the temp files get deleted too soon.

mcpost

mcpost
  • Members
  • 7 posts

Posted 20 September 2005 - 13:34

Thanks, Stefan.

I checked the exact path when the error occured in Windows Explorer and the file is intact. The function is pretty straightforward, I have enclosed in its entirety below:

function OnMaintUIBefore()
NUMBER nvSize;
STRING svName, svCompany;
begin
if CMDLINE="" then
SHELL_OBJECT_FOLDER = @PRODUCT_NAME;
svName = "";
svCompany = "Company Name";
nvSize = 0;
FeatureCompareSizeRequired(MEDIA, INSTALLDIR, nvSize);
if (nvSize != 0) then
MessageBox(szSdStr_NotEnoughSpace, WARNING);
abort;
endif;
// setup default status
Enable(STATUSEX);
bRemove = 0;
FeatureReinstall();
UNINSTALL_STRING = UNINSTALL_STRING + " UNINSTALL";
// sanity check for any leftover registry entries that are not deleted
CleanUpResidual(TRUE);
else
if (AskYesNo("Remove "+@PRODUCT_NAME+"?",NO) = YES) then
bRemove = 1;
FeatureRemoveAll();
CleanUpResidual(TRUE);
endif;
endif;
end;

What I'm trying to achieve is an effect like Major Upgrade where it simply uninstall before installing again regardless of the currently installed version on the target system.

Any help is greatly appreciated!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 20 September 2005 - 13:46

Not sure if this can work this way. You should better use a launcher that will perform the uninstall.

mcpost

mcpost
  • Members
  • 7 posts

Posted 20 September 2005 - 21:01

I actually got the idea from http://support.insta...ticleid=Q104414, replacing ComponentReinstall and ComponentRemoveAll with FeatureReinstall and FeatureRemoveAll.

I'm pretty new to the concept of Windows Installer, my previous experience was Installshield 5 several years ago, so I may not be doing it right.

My setup is launched (silent install) by another program and I'm trying to skip the Maintenance Mode. The few scenerios that launch my setup are:

1. New install

2. Upgrade on existing install - I use Major Upgrade everytime I have an update so I can clean out the existing system and reinstall.

3. Reinstall - this is where I have the problem mentioned. I want Reinstall to behave like Major Upgrade without change in version number and product code.

One caveat is I cannot manually uninstall (ie. deleting folders, shortcuts, registry) because there are files that are created by the application that needs to stay. These files can change over time so there's no way for me to keep track of.

In short, all I want is to uninstall the application and install again with only one call to the setup with one single .iss for the silent install. Sounds simple enough but I couldn't figure out how to get around Windows Installer to do that.

Am I doing it wrong? Are there better ways of doing what I want to do?

Thanks again!


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 21 September 2005 - 20:33

That article applies to InstallScript projects, not to InstallScript MSI projects.