AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / coding / 问题

Perguntas[wix](coding)

Martin Hope
Dmitry Kosovets
Asked: 2025-02-11 23:33:48 +0800 CST

O instalador do WiX ScrollableText fica vazio quando o valor da propriedade é fornecido

  • 5

Estou tentando criar um instalador WiX v4 que exibirá diferentes EULAs dependendo da região. Quando eu forneço um texto estático usando:

<Control Id="LicenseText" Type="ScrollableText" X="18" Y="105" Width="348" Height="120" TabSkip="no" Sunken="yes">
  <Text Value="!(loc.EulaInt)" />
</Control>

onde EulaInt contém o conteúdo RTF, ele é exibido corretamente. Mas quando tento fornecer um valor de propriedade usando

<Property Id="EULATEXT" Value="!(loc.EulaInt)" />
...
<Control Id="LicenseText" Type="ScrollableText" X="18" Y="105" Width="348" Height="120" TabSkip="no" Sunken="yes">
  <Text Value="[EULATEXT]" />
</Control>

Ele exibe um campo vazio. Qualquer ajuda será muito apreciada

wix
  • 1 respostas
  • 20 Views
Martin Hope
Yola
Asked: 2025-02-04 04:22:32 +0800 CST

O Wix não está coletando .runtimeconfig.json

  • 5

O Wix harvesting não inclui o arquivo .runtimeconfig.json no arquivo .wxs. Meu aplicativo não roda sem esse arquivo. Como posso incluí-lo? O que posso fazer em geral se o Wix não coletar determinado arquivo que eu quero incluir?

wix
  • 1 respostas
  • 17 Views
Martin Hope
nikhil
Asked: 2024-11-08 17:29:33 +0800 CST

O Wix não instala o novo pacote exe após o pacote antigo ser removido

  • 5

Estou tentando desinstalar o SqlServer 2017 e instalar o SqlServer 2022. Ele desinstala o SqlServer 2017, mas nunca instala o 2022. Por favor, ajude.

Tenho uma classe chamada RemoveSql2017.cs que é a seguinte:

 public class RemoveSQL2017
    {
        const string UNINSTALL_SQL_2017 = "/Action=Uninstall /INSTANCENAME=PHARMSPEC /FEATURES=SQL /QS /HIDECONSOLE";
        const string sqlFile = "DetachPharmSpecDB.sql";
        const string DB_INSTANCE = "PHARMSPEC";
        const int COMMAND_LINE_WAIT = 10000;
        private static WixBootstrapper _bootstrapper;
        const string registryKey = @"SOFTWARE\HIAC\PharmSpec\Database";
        const string subKeyValue = "DataPath";

        public RemoveSQL2017(WixBootstrapper bootstrapper)
        {
            _bootstrapper = bootstrapper;
        }

        public void Remove(string bootStrapFolder, string dataFilePath)
        {
            CreateDetachSQLFile();
            CopyFiles(dataFilePath);
            UninstallSQL(bootStrapFolder);
            DeleteDBRegistryPath();
        }
        public static void UninstallSQL(string bootstrapFolder)
        {
            try
            {
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Beginning UninstallSQL; bootstrapFolder=" + bootstrapFolder);
                Process process = new Process();
                ProcessStartInfo startInfo = new ProcessStartInfo(bootstrapFolder + "//SQL2017//setup.exe", UNINSTALL_SQL_2017);
                process.StartInfo = startInfo;
                process.Start();
                process.WaitForExit();
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Completing UninstallSQL; bootstrapFolder=" + bootstrapFolder);
            }
            catch (Exception e)
            {
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Error in UninstallSQL:\n " + e.ToString());
                throw (e);
            }
        }
        public static void CopyFiles(string dataFilePath)
        {
            try
            {
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Beginning CopyFiles; dataFilePath=" + dataFilePath + "  tempDBFilePath=" + Globals.tempDBFilePath);
                File.Copy(Path.Combine(dataFilePath, Globals.MDF_FILE), Path.Combine(Globals.tempDBFilePath, Globals.MDF_FILE));
                File.Copy(Path.Combine(dataFilePath, Globals.LDF_FILE), Path.Combine(Globals.tempDBFilePath, Globals.LDF_FILE));
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Completing CopyFiles; dataFilePath=" + dataFilePath + "  tempDBFilePath=" + Globals.tempDBFilePath);
            }
            catch (Exception e)
            {
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Error in CopyFiles:\n " + e.ToString());
            }
        }
        public static void DetachDB(string sqlFilePath)
        {
            try
            {
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Beginning DetachDB; sqlFilePath=" + sqlFilePath);
                string command = string.Format("-S .\\{0} -E -i \"{1}\"", DB_INSTANCE, sqlFilePath);
                ProcessStartInfo info = new ProcessStartInfo("sqlcmd", command);
                info.UseShellExecute = false;
                info.CreateNoWindow = false;
                info.WindowStyle = ProcessWindowStyle.Hidden;
                Process proc = new Process();
                proc.StartInfo = info;
                proc.StartInfo.RedirectStandardOutput = true;
                proc.Start();
                string outputD = proc.StandardOutput.ReadToEnd();
                if (proc.WaitForExit(COMMAND_LINE_WAIT))
                {
                    _bootstrapper.Engine.Log(LogLevel.Verbose, outputD);
                }
                else
                {
                    _bootstrapper.Engine.Log(LogLevel.Verbose, "Process timeout in DetachDb");
                }
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Completing DetachDB; sqlFilePath=" + sqlFilePath);
            }
            catch (Exception e)
            {
                _bootstrapper.Engine.Log(LogLevel.Verbose, "Error in DetachDB:\n " + e.ToString());
                throw (e);
            }
        }
        public static void CreateDetachSQLFile()
        {
            try
            {
                string sqlFilePath = Path.Combine(Path.GetTempPath(), sqlFile);
                var sqlScript = new StringBuilder();
                sqlScript.AppendLine("GO");
                sqlScript.AppendLine("IF EXISTS (SELECT * FROM sysdatabases WHERE name = N'PharmSpecDB')");
                sqlScript.AppendLine("use PharmSpecDB");
                sqlScript.AppendLine("DROP SCHEMA PharmSpecUsr");
                sqlScript.AppendLine("DROP USER PharmSpecUsr");
                sqlScript.AppendLine("use master");
                sqlScript.AppendLine("EXEC sp_detach_db 'PharmSpecDB'");
                sqlScript.AppendLine("GO");
                sqlScript.AppendLine("IF EXISTS (SELECT * FROM syslogins WHERE name = N'PharmSpecUsr')");
                sqlScript.AppendLine("DROP LOGIN PharmSpecUsr");
                sqlScript.AppendLine("GO");
                using (StreamWriter sw = new StreamWriter(sqlFilePath))
                {
                    sw.Write(sqlScript.ToString());
                }
                DetachDB(sqlFilePath);
            }
            catch (Exception e)
            {
                _bootstrapper.Engine.Log(LogLevel.Verbose, "error in CreateDetachSQLFile:\n " + e.ToString());
                throw (e);
            }
        }

        public static void DeleteDBRegistryPath()
        {
            try
            {
                using (RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
                {
                    RegistryKey subkey = key.OpenSubKey(registryKey, true);
                    if (subkey != null)
                    {
                        subkey.DeleteValue(subKeyValue);
                    }           
                }
            }
            catch (Exception e)
            {
                _bootstrapper.Engine.Log(LogLevel.Verbose, "error in DeleteDBRegistryPath:\n" + e.ToString());
            }
        }

Estou chamando essa classe da seguinte maneira: consigo ver o SqlServer 2017 sendo desinstalado.

 if (Bootstrapper.Engine.StringVariables["PreviousVersion"].CompareTo("3.5.99") <= 0 &&
               Bootstrapper.Engine.StringVariables["SqlInstanceKeyFound64"] == "1")
                {
                    RemoveSQL2017 removeSQL = new RemoveSQL2017(Bootstrapper);
                    removeSQL.Remove(Bootstrapper.Engine.StringVariables["DB2017SETUP"], Bootstrapper.Engine.StringVariables["2017DBDataPath"]);
                    Bootstrapper.Engine.StringVariables["OLDDBDATAPATH"] = Globals.tempDBFilePath;
                    Bootstrapper.Engine.StringVariables["INSTALLSQL"] = "1";
                }

Tenho um SqlServer.wxi no qual as chaves de registro e o arquivo exe são os seguintes. Antes de remover o SqlServer2017, isso é o que está no registro,

Registro

SqlServer.wxi

<Variable Name="SqlInstanceKeyFound" Value="0"/>
        <Variable Name="SqlInstanceKeyFound64" Value="0"/>
<util:RegistrySearch
          Id="SqlInstanceKeyFound64"
          Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" Value="PHARMSPEC"
          Result="exists" Variable="SqlInstanceKeyFound64" Win64="yes"/>
        <util:RegistrySearch
          Id="SqlInstanceKey64"
          Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" Value="PHARMSPEC"
          Variable="SqlInstanceKey64" After="SqlInstanceKeyFound64" Condition="SqlInstanceKeyFound64" Win64="yes" />
        <util:RegistrySearch
          Id="SqlInstanceFound64"
          Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SqlInstanceKey64]"
          Result="exists" Variable="SqlInstanceFound64" After="SqlInstanceKey64" Condition="SqlInstanceKeyFound64" Win64="yes" />
        <util:RegistrySearch
          Id="SqlVersion64"
          Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SqlInstanceKey64]\Setup" Value="Version"
          Variable="SqlVersion64" After="SqlInstanceKey64" Condition="SqlInstanceFound64" Win64="yes" />

 <PackageGroup Id="SQL2022Express">
      <ExePackage Id="SQL2022Express"
              DisplayName="SQL Server 2022 Express"
              Cache="yes"
              Compressed="no"
              PerMachine="yes"
              Permanent="no"
              Vital="yes"
              DetectCondition="SqlInstanceFound64"
              InstallCondition="INSTALLSQL=1"
              Name="Redist\SQLEXPR_x64_!(loc.LANG).exe"
              SourceFile="$(var.DependencyFolder)\SQLEXPR_x64_!(loc.LANG).exe"
              InstallCommand="/ACTION=Install /IACCEPTSQLSERVERLICENSETERMS [SQLQUIET] /HIDECONSOLE /FEATURES=SQLEngine /UpdateEnabled=0 /INSTANCENAME=PHARMSPEC /SQLSYSADMINACCOUNTS=Builtin\Administrators /SQLSVCACCOUNT=&quot;NT AUTHORITY\NETWORK SERVICE&quot; /SECURITYMODE=SQL /SAPWD=[SAPASSWORD] /NPENABLED=1 /TCPENABLED=1 /SKIPRULES=RebootRequiredCheck"
              UninstallCommand="/Action=Uninstall /INSTANCENAME=PHARMSPEC /FEATURES=SQL /QS /HIDECONSOLE">
        <ExitCode Value ="3010" Behavior="forceReboot" />
      </ExePackage>
    </PackageGroup>

No log está mostrando o seguinte:

  • [0EE8:0EEC][2024-11-08T14:09:13]i000: Definindo a variável numérica 'SqlInstanceFound64' para o valor 1
  • [0EE8:0EEC][2024-11-08T14:09:13]i052: A condição 'SqlInstanceFound' é avaliada como falsa.
  • [0EE8:0EEC][2024-11-08T14:09:13]i052: A condição 'SqlInstanceFound64' é avaliada como verdadeira.
  • [0EE8:0EEC][2024-11-08T14:09:13]i000: Definindo variável de string 'SqlVersion64' para o valor '14.0.1000.169'
  • [0EE8:0EEC][2024-11-08T14:09:13]i101: Pacote detectado: SQL2022Express, estado: Presente, em cache: Nenhum
  • [0EE8:0EEC][2024-11-08T14:09:29]i052: A condição 'INSTALLSQL=1' é avaliada como verdadeira.
  • [0EE8:0EEC][2024-11-08T14:09:29]w321: Ignorando o registro de dependência em pacote sem provedores de dependência: SQL2022Express
  • [0EE8:0EEC][2024-11-08T14:09:29]i052: A condição 'INSTALLSQL=0' é avaliada como falsa.
wix
  • 1 respostas
  • 11 Views
Martin Hope
ElDog
Asked: 2023-08-17 16:10:31 +0800 CST

Faça referência ao projeto C# de vários destinos no instalador do WiX 4, nome de ligação não encontrado

  • 5

Eu tenho um projeto C# multi-alvo construído para net framework 4.7.2 e para net 7.0. O elemento TargetFrameworks do projeto é definido como:

<TargetFrameworks>net472;net7.0-windows</TargetFrameworks>

Agora eu preciso incluir tanto o net framework quanto o net 7 build outputs no meu instalador (diferentes pastas).

Eu tento seguir as etapas descritas nesta discussão WiX: https://github.com/wixtoolset/issues/issues/7241

Inicialmente eu faço da maneira "antiga" descrita lá: para wixproj eu insiro 2 referências de projeto com diferentes BindName explicitamente especificados:

<ProjectReference Include="..\MyProject\MyProject.csproj" SetTargetFramework="TargetFramework=net472" BindName="MyProject.net472"/>
<ProjectReference Include="..\MyProject\MyProject.csproj" SetTargetFramework="TargetFramework=net7.0-windows" BindName="MyProject.net7.0-windows"/>

E então no arquivo wxs eu incluo arquivos em componentes:

...
<File Id="MyFile" Name="MyProject.dll" Source="!(bindpath.MyProject.net472)\MyProject.dll" />
...
<File Id="MyFile" Name="MyProject.dll" Source="!(bindpath.MyProject.net7.0-windows)\MyProject.dll" />

Isso parece funcionar. Os arquivos são encontrados e compactados. Mas requer 2 entradas ProjectReference no arquivo wixproj. Da maneira descrita na discussão do WiX, deve ser possível adicionar apenas um:

<ProjectReference Include="..\MyProject\MyProject.csproj" TargetFrameworks="net472,net7.0-windows"/>

que deve gerar automaticamente BindName.

No entanto, depois que eu faço isso, o arquivo com o bindpath MyProject.net472 é encontrado, mas aquele com o bindpath MyProject.net7.0-windows não é. Eu também tentei sem -windows no final, o mesmo resultado. O que está errado?

wix
  • 1 respostas
  • 16 Views

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Reformatar números, inserindo separadores em posições fixas

    • 6 respostas
  • Marko Smith

    Por que os conceitos do C++20 causam erros de restrição cíclica, enquanto o SFINAE antigo não?

    • 2 respostas
  • Marko Smith

    Problema com extensão desinstalada automaticamente do VScode (tema Material)

    • 2 respostas
  • Marko Smith

    Vue 3: Erro na criação "Identificador esperado, mas encontrado 'import'" [duplicado]

    • 1 respostas
  • Marko Smith

    Qual é o propósito de `enum class` com um tipo subjacente especificado, mas sem enumeradores?

    • 1 respostas
  • Marko Smith

    Como faço para corrigir um erro MODULE_NOT_FOUND para um módulo que não importei manualmente?

    • 6 respostas
  • Marko Smith

    `(expression, lvalue) = rvalue` é uma atribuição válida em C ou C++? Por que alguns compiladores aceitam/rejeitam isso?

    • 3 respostas
  • Marko Smith

    Um programa vazio que não faz nada em C++ precisa de um heap de 204 KB, mas não em C

    • 1 respostas
  • Marko Smith

    PowerBI atualmente quebrado com BigQuery: problema de driver Simba com atualização do Windows

    • 2 respostas
  • Marko Smith

    AdMob: MobileAds.initialize() - "java.lang.Integer não pode ser convertido em java.lang.String" para alguns dispositivos

    • 1 respostas
  • Martin Hope
    Fantastic Mr Fox Somente o tipo copiável não é aceito na implementação std::vector do MSVC 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant Encontre o próximo dia da semana usando o cronógrafo 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor O inicializador de membro do construtor pode incluir a inicialização de outro membro? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský Por que os conceitos do C++20 causam erros de restrição cíclica, enquanto o SFINAE antigo não? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul O C++20 mudou para permitir a conversão de `type(&)[N]` de matriz de limites conhecidos para `type(&)[]` de matriz de limites desconhecidos? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann Como/por que {2,3,10} e {x,3,10} com x=2 são ordenados de forma diferente? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller O ponto e vírgula agora é opcional em condicionais bash com [[ .. ]] na versão 5.2? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench Por que um traço duplo (--) faz com que esta cláusula MariaDB seja avaliada como verdadeira? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng Por que `dict(id=1, **{'id': 2})` às vezes gera `KeyError: 'id'` em vez de um TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob: MobileAds.initialize() - "java.lang.Integer não pode ser convertido em java.lang.String" para alguns dispositivos 2024-03-20 03:12:31 +0800 CST

Hot tag

python javascript c++ c# java typescript sql reactjs html

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve