Community Forums
Results 1 to 3 of 3

Thread: InstallScript is not creating TargetDir

  1. #1
    Join Date
    Jun 2011
    Posts
    38

    Angry InstallScript is not creating TargetDir

    I have an installscript project where the Target Dir is WINSYSDIR64\SCI and I've added to the onSetTargetDir function to Create the folder if it does not exist. However, even though it supposedly successfully creates the dir the dir doesn't exist and so the installer fails.
    Here is what I have for the function, I followed what was in the Help example, and in the Else portion which is supposed to be on Success I do get the MessageBox. However, the installer will fail saying the folder doesn't exist and if I check even when I get the MessageBox the folder does not exist.

    Code:
    function OnSetTARGETDIR()
    number nId, nIgnore, nResult;
    string szId, szTARGETDIR;
    begin
    
        // In maintenance mode the value of TARGETDIR is read from the log file.
        if( MAINTENANCE ) then
            return ISERR_SUCCESS;
        endif;
    
        // Set TARGETDIR to script default.
        TARGETDIR = "<WINSYSDIR64>\\SCI";
    
        // Read TARGETDIR from the media.
        nResult = MediaGetData( MEDIA, MEDIA_FIELD_TARGETDIR, nIgnore, szTARGETDIR );
    
        // Use the TARGETDIR from the media if anything was read.
        if( nResult >= ISERR_SUCCESS && StrLengthChars( szTARGETDIR ) ) then
            TARGETDIR = szTARGETDIR;
        endif;
    
    	if (ExistsDir(TARGETDIR) != EXISTS) then
    		if (CreateDir(TARGETDIR) < 0) then
    			MessageBox("Unable to create Target Installation Folder", SEVERE);
    			abort;
    		else
    			MessageBox(TARGETDIR, WARNING);
    		endif;
    	endif;
            
    
    end;
    So are the Help examples wrong?

  2. #2
    Join Date
    Jun 2011
    Posts
    38

    Angry

    Well I seemed to have found the problem. Despite it specifying the 64bit Win Sys dir this dumb thing is creating it in the syswow64 folder.

  3. #3
    Join Date
    Jun 2017
    Posts
    17
    It's because of the windows 64 bit file system redirection
    You can overcome by doing the stuffs mentioned in the below link
    https://helpnet.flexerasoftware.com/...ng64Bit-IS.htm




    Quote Originally Posted by jstarbird View Post
    Well I seemed to have found the problem. Despite it specifying the 64bit Win Sys dir this dumb thing is creating it in the syswow64 folder.

Posting Permissions

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