因此,基本上我所擁有的是Wix安裝程序,它已被修改,並且目前我的註冊表項存在問題。安裝過程中,安裝程序會有一個自定義對話框,用戶必須選擇/插入第二條路徑。哪些將被存儲在註冊表中。但不是插入用戶輸入的內容,而是插入「[INSTALLFOLDER]」,雖然它應該看起來像「C:\ Program Files ...」。我做了一些研究,但沒有找到任何可以幫助我的東西。 所有的代碼都在同一個文件中。Wix安裝程序根據用戶輸入創建註冊表項
代碼的主要部分在這裏,首先是這個屬性。以後應該寫入註冊表。
後來就有了自定義窗口。低於
<!-- NetWork path -->
<Dialog Id="CustomNETDirDlg" Width="370" Height="270" Title="Custom Folder">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Choose Network Path" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="NetWork Path" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="Choose/Enter Path" />
<Control Id="NETFOLDER" Type="Edit" X="20" Y="100" Width="320" Height="18" Text="{200}" Property="CUSTOMPATH" Indirect="yes"/>
<Control Id="CustomChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
</Dialog>
<!--/NetWork path -->
點點這部分發布...
<Publish Dialog="CustomNETDirDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg">1</Publish>
<Publish Dialog="CustomNETDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">1</Publish>
<Publish Dialog="CustomNETDirDlg" Control="CustomChangeFolder" Property="_BrowseProperty" Value="[CUSTOMPATH]" Order="1">1</Publish>
<Publish Dialog="CustomNETDirDlg" Control="CustomChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
這對我的作品。 我用「原因」替換了guid。註冊表路徑和其他一切似乎都沒有問題,只是有一件事不起作用,將[CUSTOMPATH]屬性添加爲註冊表值。我也嘗試不使用[]括號,依此類推......甚至嘗試使用[Manufacturer]完美無瑕,將製造商插入註冊表。但是,這裏不起作用。
<DirectoryRef Id="TARGETDIR">
<Component Id="RegistryEntries" Guid="{my guid}">
<RegistryValue Root='HKMU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='[CUSTOMPATH]' KeyPath='yes' />
</Component>
</DirectoryRef>
感謝它幫助我前進。 –
不客氣。請在這種情況下注意/接受答案。 – Starceaker