変数からの値に基づいたショートカットへの引数の追加が機能しない

StackOverflow https://stackoverflow.com/questions/8829006

質問

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>

私が間違っていることは何かありますか?

役に立ちましたか?

解決

<?define?> プリプロセッサ変数を作成します。これはビルド時に解決されます。実行時の概念であるプロパティが必要です。使用 <Property>, 、すべて大文字の ID を使用してパブリックにし、Secure 属性値を yes に設定して、UI からインストール ランタイムに伝播します。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top