PDA

View Full Version : is SourceDir where binary table material is located during install?



coffeendonut
07-19-2005, 10:56 AM
Hi,

I need to run an executable during install so I put it into the binary table and have a custom action to call it. It works fine but that executable creates a .ini file (in the same directory as it is located in when run) and I need to move the .ini file to INSTALLDIR.

Looking into this, it seems the property that will represent the directory where the binary table material is extracted to (i.e. my executable) is SourceDir. Using the MSI debugger, I find this property and looking into that directory (which is the same as where the setupe.exe is running from), I cannot find my .ini file.

Is SourceDir where the executable in my binary table is running?

PS I do a (windows) search for the .ini file and I can't seem to find it which adds to 'what the...' feeling.

Stefan Krueger
07-20-2005, 05:33 AM
SourceDir is the directory where your .msi file is (typically the CD drive).
I believe that Binary table files are extracted to the TEMP folder or a subfolder thereof. Try SUPPORTDIR.

coffeendonut
07-20-2005, 10:58 AM
Hi Stefan,

Thank you for your reply.

It looks TempFolder is where my binary table executable is running in (it is where the output file was placed -not sure why it didn't turn up in my windows file search, perhaps the windows file search doesn't search there).

I wonder, is this 'guaranteed'? i.e. does IS/MSI standards assure us mere mortal install developers that executables placed in the binary table are run in TempFolder? Maybe that is too much to ask for in this broken world... the reason I ask is b/c the installer has to support multiple O/S but my development machine is XPSP2. I guess we'll just have to assume this for now.

Stefan Krueger
07-20-2005, 11:04 AM
As far s I know this is not officially documented for custom action types "stored in binary table" (where Windows Installer does the extraction).
However you can manually stream files from the Binary table to whereever you like, and InstallShield can do this for you if you place the file in the Support Files view. In this case InstallShield will extract the file to [SUPPORTDIR] (this *is* documented) and you caóuld launch it from there using a custom action with "path referencing a directory" or "path specified by a property value".

coffeendonut
07-20-2005, 11:27 AM
Hi Stefan,

I just tried this, it gives me an error (2727) on my CA to launch my executable which I've moved to support files.

I put [SUPPORTDIR] as my working directory in my CA (EXE path referencing a directory). Is SUPPORTDIR available in a basic MSI project? I can't use InstallScript; is there another way to get the SUPPORTDIR location in a basic MSI project?

Stefan Krueger
07-20-2005, 01:51 PM
Î don't think that setting the working dir is enough. I believe you must specify the full path to the exe file. Yes, SUPPORTDIR should be available in Basic MSI.