wix - Why the INSTALLFOLDER property was not changed through the RadioButtonGroup? -
wix. write plugin must installed 1 of 3 directories only. therefore create custom dialog , insert chain:
this code of dialog:
<?xml version='1.0' encoding='windows-1252'?> <!-- selectinstalldirectory.wxs © andrey bushman, 2016 dialog window install directory selection of autocad extension. --> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <fragment> <ui> <!--<property id="defaultuifont">dlgfont10</property>--> <textstyle id="dlgfont10" facename="tahoma" size="10" /> <textstyle id="dlgfont20" facename="tahoma" size="20" /> <textstyle id="dlgfont10_important" facename="tahoma" size="10" red="255" green="0" blue="0"/> <textstyle id="dlgtitlefont" facename="tahoma" size="10" bold="yes" /> <!-- forced define installfolder again because selectinstalldirectory dialog doesnt see property. --> <property id="installfolder" value="$(env.programdata)\autodesk\applicationplugins\proxytools.bundle\"/> <!--this dialog selects install directory through radiobutton items.--> <dialog id="selectinstalldirectory" title="autocad extension location" nominimize="yes" width="400" height="270"> <control id="titleimage" type="bitmap" x="0" y="0" width="400" height="65" text="titleimagefile"> <binary id="titleimagefile" sourcefile="selectinstalldirectory_banner.jpg"/> </control> <control id="titletext" type="text" x="60" y="20" width="400" height="35" transparent="yes" noprefix="yes"> <text>{\dlgfont20}proxy tools autocad</text> </control> <control id="title" type="text" x="5" y="85" width="300" height="15" transparent="yes" noprefix="yes"> <text>select target directory autocad extension installing:</text> </control> <control id="rbgrpath" type ="radiobuttongroup" x="5" y="100" width="500" height="100" property="installfolder"> <radiobuttongroup property="installfolder"> <radiobutton text="[programfilesfolder]autodesk\applicationplugins\proxytools.bundle\" value="[programfilesfolder]autodesk\applicationplugins\proxytools.bundle\" height="13" width="500" x="5" y="5"/> <radiobutton text="$(env.programdata)\autodesk\applicationplugins\proxytools.bundle\" value="$(env.programdata)\autodesk\applicationplugins\proxytools.bundle\" height="13" width="500" x="5" y="20"/> <radiobutton text="$(env.appdata)\autodesk\applicationplugins\proxytools.bundle\" value="$(env.appdata)\autodesk\applicationplugins\proxytools.bundle\" height="13" width="500" x="5" y="35"/> </radiobuttongroup> </control> <control id="warning_acad2012" type="text" x="5" y="175" width="100" height="30" transparent="yes" noprefix="yes"> <text>{\dlgtitlefont}warning</text> </control> <control id="warning_acad2012_text" type="text" x="10" y="190" width="380" height="40" transparent="yes" noprefix="yes"> <text>{\dlgfont10_important}don't select "$(env.programdata)\autodesk\applicationplugins\proxytools.bundle\" variant if use autocad 2012, because bundle-autoloader don't monitor of directory.</text> </control> <control id="back" type="pushbutton" x="205" y="243" width="70" height="17" default="no" text="<< previous"> <publish event="newdialog" value="licenseagreementdlg">1</publish> </control> <control id="install" type="pushbutton" x="280" y="243" width="56" height="17" default="yes" text="install"> <publish event="newdialog" value="setuptypedlg">installfolder</publish> </control> <control id="cancel" type="pushbutton" x="340" y="243" width="56" height="17" default="no" text="cancel"> <publish event="spawndialog" value="canceldlg">1</publish> </control> </dialog> </ui> </fragment> </wix>
pay attention in selectinstalldirectory.wxs
file define again installfolder
directory, because dialog doesn't see installfolder
property when defined in other file (look below). correctly?
<directory id="targetdir" name="sourcedir"> <directory id="$(var.adsk_location)"> <directory id="adsk" name="autodesk"> <directory id="adsk_plugins" name="applicationplugins"> <directory id="installfolder" name="$(var.extension_folder_name)"> <directory id="license" name="license"/> <directory id="resources" name="resources"/> <directory id="help" name="help"/> <directory id="menu" name="menu"> <directory id="cui" name="cui"/> <directory id="cuix" name="cuix"/> </directory> <directory id="bin" name="bin"> <directory id="bin_ru" name="ru"/> </directory> </directory> </directory> </directory> </directory>
into product
element added this:
<ui id="mywixui_mondo"> <uiref id="wixui_mondo" /> <uiref id="wixui_errorprogresstext" /> <!-- dialog installfolder value getting. --> <dialogref id="selectinstalldirectory" /> <publish dialog="licenseagreementdlg" control="next" event="newdialog" value="selectinstalldirectory" order="3">licenseaccepted = "1"</publish> <publish dialog="setuptypedlg" control="back" event="newdialog" value="selectinstalldirectory">1</publish> </ui>
now custom dialog exists in chain. if select other variant of target directory in dialog window, value of installfolder
not changed actually. root feature
element uses variable value configurabledirectory
property (i use attribute debugging of plugin):
<feature id="$(var.solutionname)" title="$(var.productname)" description="the complete package." display='expand' level="1" configurabledirectory="installfolder" allowadvertise='no' installdefault='local' absent='disallow' typicaldefault='install'>
how can fix it?
the core problem point dialogs shown, it's late change directory merely setting property. instead must somehow call msisettargetpath. typically best way dialog settargetpath control event. in project, might following:
: : : <control id="install" type="pushbutton" x="280" y="243" width="56" height="17" default="yes" text="install"> <publish event="settargetpath" value="installfolder">1</publish> <publish event="newdialog" value="setuptypedlg">installfolder</publish> </control> : : :
why setting property work? because costing typically bunch of directory calculations based on initial properties, , lot of setting target paths internally. before costfinalize action, can (and must) set properties. after costfinalize must invoke msisettargetpath more directly.
Comments
Post a Comment