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.
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 elementoCustomAction
de esta manera:También puedes usar la propiedad
[INSTALLLOCATION]
en el elementoBinary
de esta manera:Esto debería resolver el código de error 2762.