Community Forums
Results 1 to 2 of 2

Thread: error C8025 MsiSetProperty : undefined identifier

  1. #1
    Join Date
    Oct 2017
    Posts
    11

    error C8025 MsiSetProperty : undefined identifier

    Hello,

    I'm trying to create a suite advanced UI project with an installscript in it.

    When i compile my sript i get an error C8025 MsiSetProperty : undefined identifier.

    I don't know where is the problem.

    Here is my installscript :
    Code:
    ////////////////////////////////////////////////////////////////////////////////
    //                                                                            
    //  IIIIIII SSSSSS                                                            
    //    II    SS                          InstallShield (R)                     
    //    II    SSSSSS      (c) 1996-2002, InstallShield Software Corporation     
    //    II        SS                     All rights reserved.             
    //  IIIIIII SSSSSS                  
    //                                                                            
    //                                                                            
    //  This template script provides the code necessary to build an entry-point 
    //  function to be called in an InstallScript custom action. 
    //                                                                            
    //                                                                            
    //    File Name:  Setup.rul                                                   
    //                                                                            
    //  Description:  InstallShield script                                        
    //
    ////////////////////////////////////////////////////////////////////////////////
    
    
    // Include Ifx.h for built-in InstallScript function prototypes, for Windows 
    // Installer API function prototypes and constants, and to declare code for 
    // the OnBegin and OnEnd events.
    #include "ifx.h"
    // Include header file for built-in functions
    #include "isrt.h"
    // Include header file for MSI API functions and constants
    #include "iswi.h"
    
        // The keyword export identifies MyFunction() as an entry-point function.
        // The argument it accepts must be a handle to the Installer database.
    	prototype LONG kernel32.GetBinaryTypeA (BYVAL STRING , BYREF INT );
    	export prototype SetOfficeBitnessProperty(HWND);
    
        // To Do:  Declare global variables, define constants, and prototype user-
        //         defined and DLL functions here.
     
    
    // To Do:  Create a custom action for this entry-point function:
    // 1.  Right-click on "Custom Actions" in the Sequences/Actions view.
    // 2.  Select "Custom Action Wizard" from the context menu.
    // 3.  Proceed through the wizard and give the custom action a unique name.
    // 4.  Select "Run InstallScript code" for the custom action type, and in
    //     the next panel select "MyFunction" (or the new name of the entry-
    //     point function) for the source. 
    // 5.  Click Next, accepting the default selections until the wizard 
    //     creates the custom action.
    //
    // Once you have made a custom action, you must execute it in your setup by 
    // inserting it into a sequence or making it the result of a dialog's 
    // control event.
    
    ///////////////////////////////////////////////////////////////////////////////
    //                                                                           
    // Definition de la propriété OFFICEBITNESS (permet de savoir si excel est 32 ou 64 bits)
    // http://codes-sources.commentcamarche.net/forum/affich-1611755-identifier-le-type-d-un-fichier-exe
    //                                                                           
    ///////////////////////////////////////////////////////////////////////////////
    function SetOfficeBitnessProperty(hMSI)
    
        NUMBER nBinaryType;
    
    	STRING svExcelFilePath;
        NUMBER nvType, nvSize;
        
    begin
       	try 
    			
    		RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
    		RegDBGetKeyValueEx("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\excel.exe","",nvType,svExcelFilePath,nvSize); 		
    		
    		
    		//MessageBox("EXCELFILEPATH \n" + svExcelFilePath, SEVERE);
    
    		if GetBinaryTypeA(svExcelFilePath, nBinaryType)>0 then
    			if (nBinaryType=6) then 
    				//64 bits
    				MsiSetProperty(hMSI, "ISOFFICE64", "1");
    			else
    				//32 bits
    				MsiSetProperty(hMSI, "ISOFFICE32", "1");
    			endif;
    			
    		else
    			//Rechecherche si le chemin comporte x86 ou x64 (WindowsApp)
    			if StrFind(svExcelFilePath,"x86")<0 && StrFind(svExcelFilePath,"x64")<0 then
    				MessageBox("EXCEL FILE PATH \n" + "Impossible to determine Office bitness" , SEVERE);
    				return ERROR_INSTALL_FAILURE;
    			else
    				if StrFind(svExcelFilePath,"x86")<0 then
    					//64 bits
    					MsiSetProperty(hMSI, "ISOFFICE64", "1");
    				else
    					//32 bits
    					MsiSetProperty(hMSI, "ISOFFICE32", "1");				
    				endif;
    			endif;
    		endif;	
    	catch  
    	    MessageBox("SetOfficeBitnessProperty Error \n" + Err.Number + "\n" + Err.Description + "\n" + Err.LastDllError , SEVERE);
    	    return ERROR_INSTALL_FAILURE;
    	endcatch;	
    
    end;
    Thanks in advance

  2. #2
    Join Date
    Oct 2017
    Posts
    11
    I think that i've found the solution, i've suppressed #include "isrt.h" and #include "iswi.h".

    Then i've used SuiteSetProperty instead of MsiSetProperty.

Posting Permissions

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