Thursday 15 January 2015

installer - WiX: Passing Install path to managed custom action -


New day, new problem ;-) still conflict with managed custom action I already have a custom action Has been able to make a call and pass some test data. Now I have to change the test data through actual data. And the problems start here: I want to call the batch file which was installed in the subdirectory of my establishment. That's why I have to pass the installation path in custom action. It can be done using customAnadet Data Mechanism but this does not work when I log in to the installation, I can see that the custom is pointing to the right path outside the installation, but as soon as I see it in customization I have a customAntaData property empty ...

Can anyone get a look on my code and give me a tip that I am doing wrong? Thanks in advance!

Merge module that calls a custom action:

  & lt; Module ID = "DflHelpInstaller" language = "1033" version = "1.0.0.0" & gt; ; & Lt; Package id = "f952de58-1dc6-46b3-872a-7a49e2d9ea0a" manufacturer = "DflHelpInstaller" installerVersion = "200" /> & Lt; Binary ID = 'RegisterDflHelpDll' sourcefile = "$ (var.REGISTERHELP.TargetDir) RegisterDflHelp.CA.dll" /> & Lt; Custom Action ID = 'RegisterDflHelp' BinaryKey = 'RegisterDflHelpDll' DllEntry = 'RegisterDflHelp' Execute = 'Deferred' /> & Lt; Custom Action ID = "RegisterDflHelp.SetProperty" Returns = "Check" Property = "RegisterDflHelp" value = '[INSTALLLOCATION]' Execute = 'Instant' /> & Lt; InstallExecuteSequence & gt; & Lt; After custom action = 'RegisterDflHelp.SetProperty' = 'CostFinalize' / & gt; & Lt; After custom action = 'RegisterDflHelp' = 'InstallFiles' / & gt; & Lt; / InstallExecuteSequence & gt; & Lt; Directory Id = "TARGETDIR" name = "SourceDir" & gt; & Lt; / Directory & gt; & Lt; ComponentGroupRef id = "Help Group" /> & Lt; / Module & gt; & Lt; / Wix & gt;  

  & lt; Directory id = "turgitidir" name = "SourceDir" & gt; & Lt; Directory Id = "ProgramFilesFolder" Source Name = "PFFiles" & gt; & Lt; Directory id = "company" name = '$ (var.COMPANY)' & gt; & Lt; Directory id = "INSTALLLOCATION" source name = '$ var.v [SDK_VERSION]' & gt; & Lt; Component ID = "MyBanner" guide = "C8C 28B92-9326-4991-1BFB1-BbDFDF 3653AB" & gt; & Lt; File id = "banner.bmp" source = "banner.bmp" pyth = "yes" disk id = "1" /> & Lt; / Component & gt; & Lt; Merge ID = "DflHelpInstaller" SourceFile = "DflHelpInstaller.msm" language = "1033" diskID = "1" /> & Lt; / Directory & gt; & Lt; / Directory & gt;  

....

  & lt; Feature ID = "Full" title = "Setup" Details = "Installs SDK on your local machine." Display = "detail" level = "1" configurable directory = "INSTALLLOCATION" & gt; & Lt; ComponentRef Id = "Banner" /> & Lt; ComponentRef Id = "UNINSTALLER" /> & Lt; ComponentGroupRef id = "Reference group" / & gt; & Lt; MergeRef id = "DflHelpInstaller" /> & Lt; / Feature & gt; Custom Action:  
  Public Sections Custom Action {[Custom Action] Public Stable Action Register Delphahlap (session session) {session.log ("Custom Start action 1 "); Session Logs ("before access to customsadata"); // should have the installation path - unfortunately it is empty! Why? String cad = session ["CustomActionData"]; Debugger.Break (); RegisterHelp (CAD); Session.log ("The end of the custom verb .."); Return action Success; }  

If you portray your data ...

  & lt; Custom Action ID = "Microactive Action Data" Return = "Check" Property = "MyCastAction" value = 'PROPERTY0 = [PROPERTY0]; PROPERTY1 = [PROPERTY1]; PROPERTY2 = [PROPERTY2] 'Excipulate =' Instant '/ & gt;  

You can access data like this:

  string property0 = session.CustomActionData ["Property0"]; String property1 = session.CustomActionData ["Property1"]; String property 2 = session. CustomActionData ["Property2"];  

In the previous example, you will use it:

  & lt; Custom Action ID = "RegisterDflHelp.SetProperty" Return = "check" property = "RegisterDflHelp" Value = 'INSTALLLOCATION = [INSTALLLOCATION]' Execute = 'Instant' />  

then

  string cad = session.CustomActionData ["INSTALLLOCATION"];  

No comments:

Post a Comment