cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Ken_Hartlen
Level 4

INSTALLDIR - Basic MSI. Value was okay, but now it is empty

Hi all,

I had imported an existing IS 10.5 Basic MSI project in IS 2008 planning to make some improvements to the project.

During testing the INSTALLDIR was always blank causing ChangeDirectory( INSTALLDIR ) to fail in some of my Custom Actions when they tried to launch programs in the installed path.

I gave up and start a fresh project in IS 2008. All was well until close to the end of the project recreation when I started adding Custom Actions and properties again. Now INSTALLDIR is blank again. I tried backing out some of the last additions, but INSTALLDIR remains blank.

In the Install-Execute sequences, my Custom Actions are located:

- Between RemoveFolders and CreateFolders
- Between WriteRegistryValues and WriteIniValues

I noticed that the standard sequencing differs considerably from IS 10.5 and suspect it is a sequencing issue.

Any idea what may suddenly cause the INSTALLDIR value to be empty when it was okay?

Thanks in advance.

Ken Hartlen
Labels (1)
0 Kudos
(7) Replies
Ken_Hartlen
Level 4

Ken Hartlen wrote:


In the Install-Execute sequences, my Custom Actions are located:

- Between RemoveFolders and CreateFolders
- Between WriteRegistryValues and WriteIniValues



Its not the location of the Custom Actions, it is the In-Script Execution type.

My Custom Actions are "Deferred" and as soon as I change them to "Immediate" then INSTALLDIR is set. But, now the Custom Actions don't work since they need to be Deferred.

Ken
0 Kudos
RobertDickau
Flexera Alumni

To read a property during deferred mode, you'll need to go through CustomActionData; please see the docs linked from the sticky post at the top of this forum for more information. Searching these forums for "CustomActionData" will turn up many examples, too.
0 Kudos
Ken_Hartlen
Level 4

Okay, let see if I have this straight. After reading up on CustomActionData and getting the sample from the IS2008 Help working...

I have several deferred Custom Actions that use INSTALLDIR. So, for each Custom Action, I need to create a Set-a-Property Custom action and set the Property Value whose Property Name must match the Custom Action that uses the said Property Name?

I have five deferred Custom Actions needing INSTALLDIR, so I would need five Set-a-Property Custom Actions and five unique Properties Names?

And, this functional change was done to accommodate installations on MS Vista?

Thanks.

Ken
0 Kudos
Ken_Hartlen
Level 4

Well that was fun!

The nice and simple use of INSTALLDIR, etc. has evolved into a land mine of interdependent CustomActions and Property Names now.

Lots of comments in the script so I don't forget how this works several months from now.

Ken
0 Kudos
BrianPost
Level 2

Using either Windows Installshield 12 Professional or Installshield 2008 premier editon.

I have custom actions with Deferred Execution in System context which also has a CustomActionData associated with it.

If on XP I choose Remove from Add/Remove programs then INSTALLDIR is an empty string. If I choose Change & then choose remove INSTALLDIR contains the directory I installed my files in.

The same behaviour happens on Vista except that it's empty with Uninstall & correct with Change & then choose remove.

What am I doing wrong?

I tried to verify my basic MSI & CustomAction script was setup as per your recommendation, I never found the correct link.
This link http://knowledge.macrovision.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q112115&sliceId= has an item for me to select but just takes me to the same page. I selected "Discussion on Basic MSI Projects with InstallScript Custom Actions" which didn't work.

I can't sign in as we don't have a maintenance plan.
0 Kudos
DebbieL
Level 17

Sorry about the problem in the KB article. I'll see if that can be fixed as soon as possible. In the meantime, the same content is available in the InstallShield Help Library that is installed with InstallShield, and it is also available on the HelpNet site. I believe that the name of the help topic that you'll want to see is Upgrading InstallShield 11.5 or Earlier Basic MSI Projects that Have InstallScript Custom Actions.

I hope that helps.

Debbie Landers
Macrovision Corporation
0 Kudos
BrianPost
Level 2

Had to move my SetProperty custom actions after InstallInitialise, I had them earlier which is why they failed on the uninstall case.
0 Kudos