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

Fehler 2762


1 reply to this topic

trutmrol

trutmrol
  • Members
  • 94 posts

Posted 10 July 2002 - 07:49

Hallo,
in meinem MSI definierte ich eine CustomAction das
einen Wert aus der Registery ausliesst.
Die Action läuft unter 'Deferred execution system context'.

Fehlermeldung ' Internal Error 2762'

Problem:
Installation unter Windows 2000 mit 'elevated privileges as a no-admin'. Die Action sollte die Registery lesen und danach
den Path setzen.

Danke fuer die Hinweise.

---------------------------------------------------------
Action Sorce:
function DetectInstallDir(hMSI)  
LONG    nvKeyType, nvKeyValSize;  
NUMBER  nvReturn;
STRING  svInstallDir, svErrorStr;
begin  
  nvReturn = 0;  
 
  RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
  if ( RegDBKeyExist ( TBAKEY ) = 1 ) then  
      if ( RegDBGetKeyValueEx ( TBAKEY, TBA_REGVAR_INSTALL_DIR,
                                nvKeyType, svInstallDir, nvKeyValSize) != 0 ) then
         MessageBox("Can't read registery "+TBAKEY^TBA_REGVAR_INSTALL_DIR, SEVERE);
         nvReturn = -1;
      else
         nvReturn = MsiSetProperty(hMSI,"INSTALLDIR",  svInstallDir);
         if (nvReturn != 0) then
              nvReturn = NumToStr (svErrorStr, nvReturn);
            MessageBox("Faild to set INSTALLDIR to "+ svInstallDir+ "ErrorNo: "+svErrorStr, INFORMATION);
            nvReturn = -2;
            goto ERROR_PATH;
         else
            TARGETDIR = svInstallDir;
         endif;
         nvReturn = MsiSetProperty(hMSI,"TARGETDIR",  svInstallDir);  
         if (nvReturn != 0) then
            nvReturn = NumToStr (svErrorStr, nvReturn);
            MessageBox("Faild to set TARGETDIR to "+ svInstallDir + "ErrorNo: "+svErrorStr, INFORMATION);
            nvReturn = -3;
            goto ERROR_PATH;
         endif;
         //MsiGetProperty(hMSI,"TARGETDIR",svInstallDir,nvKeyValSize);  
         //MessageBox("TARGETDIR auf = "+ svInstallDir, INFORMATION);
         
         //MsiGetProperty(hMSI,"INSTALLDIR",svInstallDir,nvKeyValSize);  
         //MessageBox("INSTALLDIR auf = "+ svInstallDir, INFORMATION);      
         //nvReturn = 0;
      endif;
  else
      RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
      if( RegDBKeyExist ( TBAKEY ) < 0 )  then
         MessageBox("1 DetectInstallDir  RegDBKeyExist ( "+TBAKEY, SEVERE);  
      else  
         MessageBox("2 DetectInstallDir  RegDBKeyExist ( "+TBAKEY, SEVERE);  
      endif;
      MessageBox("Please run '....exe' to install the software.", SEVERE);
      abort;
  endif;
ERROR_PATH:
  if (nvReturn != 0) then
  nvReturn = NumToStr (svErrorStr, nvReturn);
  if (AskYesNo ("Please run ....exe to install the software. \n\n"+
                "Press <YES> to ABORT the Installation!", YES ) = YES ) then
            abort;
     endif;
  endif;
  return(nvReturn);
end;
Thanks, Roland

trutmrol

trutmrol
  • Members
  • 94 posts

Posted 10 July 2002 - 14:01

Problem ist unter
http://support.installshield.com/kb unter Q103213
beschieben und teilweise gelöst.

Offenes Problem
Aufrufen von MsiSetProperty in 'Custom Action' die
mit 'Deferred execution in System context' gestartet
werden.

Frage:
Ist es moeglich das unter Windows 2000 mit 'elevated privileges' ein Package installiert kann wenn in 'Custom Action'
die Funktion 'MsiSetProperty' verwendet wird.
Thanks, Roland