This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: InstallScript is not creating TargetDir
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Dec 18, 2018
01:41 PM
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.
So are the Help examples wrong?
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?
(2) Replies
‎Dec 20, 2018
01: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
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.