PDA

View Full Version : InstallScript is not creating TargetDir



jstarbird
12-18-2018, 02:41 PM
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.



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?

jstarbird
12-18-2018, 05:58 PM
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.

banna_k
12-20-2018, 02:11 AM
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/installshield22helplib/helplibrary/Targeting64Bit-IS.htm





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.