Can not use SOURCEDIR in an Install property - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

MikeMurnane
Posts: 30
Joined: Wed Dec 08, 2010 5:46 pm

Can not use SOURCEDIR in an Install property

I am trying to construct a path to an exe that is beside my msi but I am not able to get it to resolve when the exe is called in a custom action.

Here are log snippets that seem to show SOURCEDIR getting set and assigned to my property MSIDIR ... but it is not available when the custom action is executed ...

Code: Select all

=== Verbose logging started: 4/15/2011  14:53:35  Build type: SHIP UNICODE 4.05.6001.00  Calling process: C:\WINDOWS\system32\msiexec.exe ===
MSI (c) (1C:04) [14:53:36:083]: Resetting cached policy values
MSI (c) (1C:04) [14:53:36:098]: Machine policy value 'Debug' is 0
MSI (c) (1C:04) [14:53:36:114]: ******* RunEngine:
           ******* Product: C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\SVNProjectName.msi
...
MSI (c) (1C:04) [14:53:37:239]: PROPERTY CHANGE: Deleting SOURCEDIR property. Its current value is 'SOURCEDIR'.
...
MSI (c) (1C:04) [14:53:38:067]: PROPERTY CHANGE: Adding SourceDir property. Its value is 'C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\'.
MSI (c) (1C:04) [14:53:38:083]: PROPERTY CHANGE: Adding SOURCEDIR property. Its value is 'C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\'.
...
MSI (c) (1C:04) [14:53:45:614]: Doing action: ExecuteAction
Action 14:53:45: ExecuteAction. 
Action start 14:53:45: ExecuteAction.
MSI (c) (1C:04) [14:53:45:692]: PROPERTY CHANGE: Adding SECONDSEQUENCE property. Its value is '1'.
MSI (c) (1C:04) [14:53:45:708]: Grabbed execution mutex.
MSI (c) (1C:04) [14:53:45:739]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (c) (1C:04) [14:53:45:755]: Switching to server: AI_INSTALL="1" APPDIR="f:\" TARGETDIR="C:\" SVNAPPS_PLUSVERSION="f:\applications\SVNApplicationsName\SVNAPPS0.0.0.0\" SVNPROJECTPRODUCT_PLUSVERSION="f:\products\SVNProjectProductName\SVNPROD0.0.0.0\" SOURCEDIR="C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\" MSIDIR="C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\" OLDPRODUCTS="{81C18DE8-6A0C-4F17-98F0-C31ADA3ADAA3};{66204777-BCF6-46CA-9E22-66AD6D4D06F6};{9126550E-95C4-466D-A51B-9830C65FD5DD}" COMPANYNAME="EBSCO Publishing" AWRUN="C:\appworx\c\awrun.exe" EXECAWRUNBAT="C:\appworx\site\ExecAwrun.bat" APPWORXIMPORTDIR="C:\appworx\import\" SOSITEBAT="C:\appworx\site\sosite.bat" SHORTCUTDIR="C:\Documents and Settings\All Users\Start Menu\Programs\EBSCO PublishingSVNProjectName" AI_DOTNET35_SEARCH="#1" AI_DOTNET40_CLIENTPROFILE_SEARCH="#1" AI_DOTNET40_SEARCH="#1" CURRENTDIRECTORY="C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\AdvInstallProjects" CLIENTUILEVEL="0" CLIENTPROCESSID="2588" USERNAME="EBSCO Employee" ACTION="INSTALL" EXECUTEACTION="INSTALL" SECONDSE
MSI (s) (68:78) [14:53:45:801]: Running installation inside multi-package transaction C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\SVNProjectName.msi
MSI (s) (68:78) [14:53:45:817]: Grabbed execution mutex.
MSI (s) (68:94) [14:53:45:848]: Resetting cached policy values
MSI (s) (68:94) [14:53:45:880]: Machine policy value 'Debug' is 0
MSI (s) (68:94) [14:53:45:895]: ******* RunEngine:
           ******* Product: C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\SVNProjectName.msi
           ******* Action: INSTALL
           ******* CommandLine: **********
...
MSI (s) (68:94) [14:53:46:676]: Command Line: AI_INSTALL=1 APPDIR=f:\ TARGETDIR=C:\ SVNAPPS_PLUSVERSION=f:\applications\SVNApplicationsName\SVNAPPS0.0.0.0\ SVNPROJECTPRODUCT_PLUSVERSION=f:\products\SVNProjectProductName\SVNPROD0.0.0.0\ SOURCEDIR=C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\ MSIDIR=C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\ OLDPRODUCTS={81C18DE8-6A0C-4F17-98F0-C31ADA3ADAA3};{66204777-BCF6-46CA-9E22-66AD6D4D06F6};{9126550E-95C4-466D-A51B-9830C65FD5DD} COMPANYNAME=EBSCO Publishing AWRUN=C:\appworx\c\awrun.exe EXECAWRUNBAT=C:\appworx\site\ExecAwrun.bat APPWORXIMPORTDIR=C:\appworx\import\ SOSITEBAT=C:\appworx\site\sosite.bat SHORTCUTDIR=C:\Documents and Settings\All Users\Start Menu\Programs\EBSCO PublishingSVNProjectName AI_DOTNET35_SEARCH=#1 AI_DOTNET40_CLIENTPROFILE_SEARCH=#1 AI_DOTNET40_SEARCH=#1 CURRENTDIRECTORY=C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\AdvInstallProjects CLIENTUILEVEL=0 CLIENTPROCESSID=2588 USERNAME=EBSCO Employee ACTION=INSTALL EXECUTEACTION=INSTALL SECONDSEQUENCE=1 MIGRATE={81C18DE8-6A0C-4F17-98F0-C31ADA3ADAA
...
MSI (s) (68:94) [14:53:47:255]: PROPERTY CHANGE: Modifying SOURCEDIR property. Its current value is 'SOURCEDIR'. Its new value: 'C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\'.
MSI (s) (68:94) [14:53:47:270]: PROPERTY CHANGE: Modifying MSIDIR property. Its current value is 'MSIDIR'. Its new value: 'C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\'.
...
MSI (s) (68:94) [14:53:47:926]: PROPERTY CHANGE: Deleting SOURCEDIR property. Its current value is 'C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\'.
...
MSI (s) (68:94) [14:53:54:067]: PROPERTY CHANGE: Adding SourceDir property. Its value is 'C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\'.
MSI (s) (68:94) [14:53:54:098]: PROPERTY CHANGE: Adding SOURCEDIR property. Its value is 'C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\'.
MSI (s) (68:94) [14:53:54:114]: PROPERTY CHANGE: Adding SourcedirProduct property. Its value is '{4E563B1A-3A39-4F6B-8ED3-211E2116EE4C}'.
MSI (s) (68:94) [14:53:54:145]: SOURCEDIR ==> C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\
MSI (s) (68:94) [14:53:54:161]: SOURCEDIR product ==> {4E563B1A-3A39-4F6B-8ED3-211E2116EE4C}
...
Action 14:54:02: MAKECURRENT. 
MSI (s) (68:94) [14:54:02:770]: Executing op: CustomActionSchedule(Action=MAKECURRENT,ActionType=1074,Source=MSIDIR\MakeCurrentRun.exe,Target=f:   SVNApplicationsName  SVNAPPS0.0.0.0  SVNProjectProductName  SVNPROD0.0.0.0 applications,)
MSI (s) (68:94) [14:54:02:817]: Note: 1: 1721 2: MAKECURRENT 3: MSIDIR\MakeCurrentRun.exe 4: f:   SVNApplicationsName  SVNAPPS0.0.0.0  SVNProjectProductName  SVNPROD0.0.0.0 applications 
Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: MAKECURRENT, location: MSIDIR\MakeCurrentRun.exe, command: f:   SVNApplicationsName  SVNAPPS0.0.0.0  SVNProjectProductName  SVNPROD0.0.0.0 applications 
MSI (s) (68:94) [14:54:08:739]: Product: SVNProjectName -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: MAKECURRENT, location: MSIDIR\MakeCurrentRun.exe, command: f:   SVNApplicationsName  SVNAPPS0.0.0.0  SVNProjectProductName  SVNPROD0.0.0.0 applications 

Action ended 14:54:08: InstallExecute. Return value 3.
...
Action ended 14:54:09: INSTALL. Return value 3.
...
Property(S): SourceDir = C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\
...
Property(S): SOURCEDIR = C:\_EpWork\_Ep\Builds\VC8_DBI_VC9\InstallProto\dist\Install\
...
Property(S): SourcedirProduct = {4E563B1A-3A39-4F6B-8ED3-211E2116EE4C}

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can not use SOURCEDIR in an Install property

Hello,

The folder paths are resolved during the CostFinalize standard action. If you want your custom behavior to use the SOURCEDIR property, you should schedule everything after CostFinalize in the sequence.

From your log files it also seems you have referenced the property in the wrong way in the formmated field. You can try to schedule a "Launch File or Open URL" custom action with the following command line:

Code: Select all

[MSIDIR]MakeCurrentRun.exe
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MikeMurnane
Posts: 30
Joined: Wed Dec 08, 2010 5:46 pm

Re: Can not use SOURCEDIR in an Install property

Thanks - your support is always quick and accurate. Using the predefined custom action works. :D

Can you point me to some info about when to use/not-use predefined custom action ... and when to use "[PROPERTY] vs [|PROPERTY] ?

Thanks again.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can not use SOURCEDIR in an Install property

Hello,

You can schedule your "Launch File or Open URL" anywhere after the CostFinalize standard action for the reason I described in my previous post. Different predefined custom actions can be scheduled under different standard actions. Their usage details including when to schedule them in the sequence are part of their description.

The following represents a reference to a formatted field in Advanced Installer:

Code: Select all

[PROPERTY]
Formatted fields are resolved at install time.

The following represents a reference to a pseudo-formatted field in Advanced Installer:

Code: Select all

[|PROPERTY]
Formatted fields are resolved at build time.

To find the type of the field in the Advanced Installer GUI, simply look up the help reference by pressing F1.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MikeMurnane
Posts: 30
Joined: Wed Dec 08, 2010 5:46 pm

Re: Can not use SOURCEDIR in an Install property

Thanks so much -- your explanation of the difference between Formatted Field and Pseudo-Formatted field was very clear and should be added to your site's documentation.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can not use SOURCEDIR in an Install property

Hello,

Thank you for your suggestion. I have forwarded it to our technical writing team and we will consider adding the improvement to our user guide.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Civilian
Posts: 2
Joined: Thu Oct 06, 2011 10:11 am

Re: Can not use SOURCEDIR in an Install property

Thnx for the explanation. So the SourceDir property points to a real directory: the one where your MSI file sits?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can not use SOURCEDIR in an Install property

Hi,

The SOURCEDIR Advanced Installer property resolves to the location of the MSI file. It is resolved when you launch the MSI package and it shouldn't be confused with the SourceDir Windows Installer property.

The SourceDir Windows Installer property points the path of the MSI package folder.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”