Fix WSP registry locator.

This commit is contained in:
McMak 2015-05-08 21:55:14 +03:00
parent 45fcf3f297
commit 5ab109df9a
2 changed files with 17 additions and 18 deletions

View file

@ -540,8 +540,8 @@
<!---->
<Property Id="VALIDATE_OK" Secure="yes" Value="0" />
<Property Id="VALIDATE_MSG" Secure="yes" />
<Property Id ="WSP_ROOT" Secure="yes">
<RegistrySearch Id='Search_WSP_ROOT' Root='HKCU' Key='SOFTWARE\[ProductName]' Name='Root' Type='raw' />
<Property Id ="WSP_BASE" Secure="yes">
<RegistrySearch Id='Search_WSP_BASE' Root='HKLM' Key='SOFTWARE\[ProductName]' Name='Base' Type='raw' />
</Property>
<!--CustomActions.-->
<!-- <CustomAction Id='AlreadyUpdated' Error='Product has already been updated to $(var.VERSION) or newer.' />
@ -590,7 +590,7 @@
<CustomAction Id="CA_PropertyOnPortalRemove" Property="CA_OnPortalRemove" Value="InstallerFolder=[WEBSITEPANELDIR];ComponentCode=portal;BaseDirectory=[WEBSITEPANELDIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" />
<CustomAction Id="CA_OnPortalRemove" BinaryKey="Assembly_CA" DllEntry="OnPortalRemove" Impersonate="no" Execute="deferred" HideTarget="no" />
<!---->
<SetProperty Id="WEBSITEPANELDIR" After="AppSearch" Value="[WSP_ROOT]">WSP_ROOT</SetProperty>
<SetProperty Id="WEBSITEPANELDIR" After="AppSearch" Value="[WSP_BASE]">WSP_BASE</SetProperty>
<CustomAction Id="CA_PreFillSettings" BinaryKey="Assembly_CA" DllEntry="PreFillSettings" />
<!--Exe sequence.-->
<InstallExecuteSequence>
@ -684,9 +684,9 @@
<Component Id ="comp_WebsitePanel_config" Directory="WEBSITEPANELDIR" Guid="{28CD1ADB-562C-4E38-A3B6-325D3A2718B1}">
<File Id="file_WebsitePanel_config" KeyPath="yes" Source="WebsitePanel.config" />
</Component>
<Component Directory="WEBSITEPANELDIR">
<RegistryValue Root='HKCU' Key='SOFTWARE\[ProductName]'
Name='Root' Value='[WEBSITEPANELDIR]'
<Component Id="comp_WebsitePanel_reg_locator" Directory="WEBSITEPANELDIR" Guid="{CC35E1B5-3E29-4AD1-991C-2904E4DCB099}">
<RegistryValue Root='HKLM' Key='SOFTWARE\[ProductName]'
Name='Base' Value='[WEBSITEPANELDIR]'
Type='string' />
</Component>
</ComponentGroup>

View file

@ -68,17 +68,6 @@ namespace WebsitePanel.WIXInstaller
Log.WriteEnd("PreFillSettings");
return ActionResult.Success;
}
private static void TryApllyNewPassword(Session Ctx, string Id)
{
var Pass = Ctx[Id];
if(string.IsNullOrWhiteSpace(Pass))
{
Pass = Guid.NewGuid().ToString();
Ctx[Id] = Pass;
Ctx[Id + "_CONFIRM"] = Pass;
Log.WriteInfo("New password was applied to " + Id);
}
}
[CustomAction]
public static ActionResult InstallWebFeatures(Session session)
{
@ -778,6 +767,17 @@ namespace WebsitePanel.WIXInstaller
{
Debugger.Launch();
}
private static void TryApllyNewPassword(Session Ctx, string Id)
{
var Pass = Ctx[Id];
if (string.IsNullOrWhiteSpace(Pass))
{
Pass = Guid.NewGuid().ToString();
Ctx[Id] = Pass;
Ctx[Id + "_CONFIRM"] = Pass;
Log.WriteInfo("New password was applied to " + Id);
}
}
}
public static class SessionExtension
{
@ -788,7 +788,6 @@ namespace WebsitePanel.WIXInstaller
WiXSetup.InstallLogListener(new WiXLogFileListener());
}
}
internal enum WiXInstallType: byte
{
InstallServer,