将参数添加到基于变量的快捷方式值不起作用

发布于 2024-12-26 14:43:25 字数 1703 浏览 4 评论 0原文

我有一个 2006 时代的应用程序,需要为其创建安装程序。为了使应用程序正常工作,需要将 SQL Server 实例和数据库名称添加到快捷方式的参数中。

我遇到的问题是我的变量值没有填充快捷方式的参数。

从安装日志中,我可以看到变量值是从自定义对话框中填充的,并且我可以看到正在创建的快捷方式,但没有添加参数。

<?define SqlServerInstance="SqlServerInstance" ?>
<?define DatabaseName="DatabaseName" ?>

<Component Id="LWS" Guid="0FB32FAD-83B2-4C0B-B929-C93220E4681A">
    <File Id='LwsEXE' Name='Lws.exe' DiskId='1' Source='..\files\lws\Lws.exe' KeyPath='yes'>
        <Shortcut Id="startmenuLWS" Directory="ProgramMenuFolder" Name="LWS" WorkingDirectory='INSTALLDIR' Icon="LWS.ico" IconIndex="0" Advertise="yes" Arguments="[SqlServerInstance] [DatabaseName]"  />
        <Shortcut Id="desktopLWS" Directory="DesktopFolder" Name="LWS" WorkingDirectory='INSTALLDIR' Icon="LWS.ico" IconIndex="0" Advertise="yes" Arguments="[SqlServerInstance] [DatabaseName]"  />
    </File>
</Component>

<Dialog Id="DatabaseLocationDlg" Width="370" Height="270" Title="[ProductName] Database Connection [Setup]" NoMinimize="yes">
    <Control Id="ServerNameLabel" Type="Text" X="45" Y="73" Width="100" Height="15" TabSkip="no" Text="&amp;SQL Server Name:" />
    <Control Id="ServerNameEdit" Type="Edit" X="45" Y="85" Width="220" Height="18" Property="$(var.SqlServerInstance)" Text="[SqlServerInstance]" />
    <Control Id="DataBaseLabel" Type="Text" X="45" Y="110" Width="100" Height="15" TabSkip="no" Text="&amp;Database Name:" />
    <Control Id="DatabaseEdit" Type="Edit" X="45" Y="122" Width="220" Height="18" Property="$(var.DatabaseName)" Text="[DatabaseName]" />
    <!-- more stuff here-->
</Dialog>

有什么想法我做错了吗?

I have a 2006 era application that I need to create an installer for. For the application to work correctly the SQL Server instance and database name need to be added to the arguments of the shortcut.

The issue I am having is that my variable values are not populating the arguments of a shortcut.

From the install log, I can see that the variables values get populated from a custom dialog and i can see the shortcut being created but the arguements are not being added.

<?define SqlServerInstance="SqlServerInstance" ?>
<?define DatabaseName="DatabaseName" ?>

<Component Id="LWS" Guid="0FB32FAD-83B2-4C0B-B929-C93220E4681A">
    <File Id='LwsEXE' Name='Lws.exe' DiskId='1' Source='..\files\lws\Lws.exe' KeyPath='yes'>
        <Shortcut Id="startmenuLWS" Directory="ProgramMenuFolder" Name="LWS" WorkingDirectory='INSTALLDIR' Icon="LWS.ico" IconIndex="0" Advertise="yes" Arguments="[SqlServerInstance] [DatabaseName]"  />
        <Shortcut Id="desktopLWS" Directory="DesktopFolder" Name="LWS" WorkingDirectory='INSTALLDIR' Icon="LWS.ico" IconIndex="0" Advertise="yes" Arguments="[SqlServerInstance] [DatabaseName]"  />
    </File>
</Component>

<Dialog Id="DatabaseLocationDlg" Width="370" Height="270" Title="[ProductName] Database Connection [Setup]" NoMinimize="yes">
    <Control Id="ServerNameLabel" Type="Text" X="45" Y="73" Width="100" Height="15" TabSkip="no" Text="&SQL Server Name:" />
    <Control Id="ServerNameEdit" Type="Edit" X="45" Y="85" Width="220" Height="18" Property="$(var.SqlServerInstance)" Text="[SqlServerInstance]" />
    <Control Id="DataBaseLabel" Type="Text" X="45" Y="110" Width="100" Height="15" TabSkip="no" Text="&Database Name:" />
    <Control Id="DatabaseEdit" Type="Edit" X="45" Y="122" Width="220" Height="18" Property="$(var.DatabaseName)" Text="[DatabaseName]" />
    <!-- more stuff here-->
</Dialog>

Any ideas what I am doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

來不及說愛妳 2025-01-02 14:43:26

创建一个预处理器变量,该变量在构建时解析。您需要一个属性,这是一个运行时概念。使用 ,通过使用全大写的 Id 将其公开,并将 Secure 属性值设置为 yes 以从 UI 传播到安装运行时。

<?define?> creates a preprocessor variable, which is resolved at build time. You want a property, which is a runtime concept. Use <Property>, make it public by using an Id that's all uppercase, and set the Secure attribute value to yes to propagate from the UI to the install runtime.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文