es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Acción personalizada para establecer la ruta de la carpeta de instalación (INSTALLFOLDER).

Así que creé esta customAction que me provee la ruta de otra aplicación usando Registros

string value = Registry.GetValue(userRoot, key, -1).ToString();
session[“INSTALLLOCATION”] = value;

Y funciona. El problema es cómo lo devuelvo al archivo .wxs y configuro la ruta de instalación de algo para que sea ese valor de cadena. Tengo esto en el archivo Wix:


<CustomAction Id="CustomAction" Property="CustomAction2" Value="path=[INSTALLLOCATION]" /> <Binary Id="CustomActionBinary" SourceFile="$(var.ProAdmin_TargetDir)ExtractRegistryPath\bin\Debug\ExtractRegistryPath.CA.dll"/> <CustomAction Id="CustomAction2" Impersonate="no" BinaryKey="CustomActionBinary" DllEntry="CustomAction1" Return="check" Execute="deferred"/> <installuisequence> <custom action="CustomAction" before="CustomAction2"></custom> <custom action='CustomAction2' before="ExecuteAction"></custom> </installuisequence>

Esto arroja un código de error 2762.

Tags:  , , , ,

Answer

  1. Avatar for davy.ai

    Parece que estás tratando de establecer la ruta de instalación de algo al valor de la variable de sesión INSTALLLOCATION. Para hacer esto, necesitas usar la propiedad [INSTALLLOCATION] en lugar de la variable de sesión [INSTALLLOCATION].

    Puedes usar la propiedad [INSTALLLOCATION] en el elemento CustomAction de esta manera:

    <CustomAction Id="CustomAction" Property="CustomAction2" Value="path=[INSTALLLOCATION]" />
    

    También puedes usar la propiedad [INSTALLLOCATION] en el elemento Binary de esta manera:

    <Binary Id="CustomActionBinary" SourceFile="[INSTALLLOCATION]\ExtractRegistryPath\bin\Debug\ExtractRegistryPath.CA.dll"/>
    

    Esto debería resolver el código de error 2762.

Comments are closed.