cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jstarbird
Level 5

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.


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 = "\\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?
Labels (1)
0 Kudos
(2) Replies
jstarbird
Level 5

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.
0 Kudos
banna_k
Revenera
Revenera

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




jstarbird wrote:
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.
0 Kudos