2010-12-14 6 views
3

안녕하세요 설치를 위해 wix와 협력하고 있습니다. 사용자가 포트를 정의 할 수 있도록 사용자 정의 대화 상자가 필요합니다. 대화 상자에는 MaskedEdit 유형의 컨트롤이있어 포트를 작성해야합니다. 컨트롤에 연결된 속성에는 정의 된 기본값이 있습니다. 문제는 사용자가 다음 버튼을 누르면 포트 필드에 값이 있는지 확인하거나 경고를 표시하는 것입니다. 컨트롤 코드는 다음과 같습니다MaskedEdit 컨트롤에 텍스트가 포함되어 있는지 확인하십시오.

<Property Id="DataStoragePort">4323</Property> 

    <Dialog Id="DataStoragePortConfig" Width="370" Height="270" Title="CellaVision DM1 Setup"> 
    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next"> 
    </Control> 
    <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back"> 
    </Control> 
    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel"> 
     <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> 
    </Control> 

    <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Data Storage Configuration" /> 
    <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="DSDescription" Type="Text" X="20" Y="60" Width="250" Height="13" NoPrefix="yes" Text="Enter the port that the Data Storage Service should run on" /> 
    <Control Id="DSPort" Type="Text" X="20" Y="80" Width="20" Height="13" NoPrefix="yes" Text="Port:" /> 
    <Control Id="DSText" Type="MaskedEdit" Text="#####" X="45" Y="78" Width="70" Height="14" Property="DataStoragePort" /> 
    </Dialog> 

하고 다음 버튼을 클릭의 처리를 다음과 같이 :

 <Publish Dialog="DataStoragePortConfig" Control="Back" Event="NewDialog" Value="CustomizeDlg">1</Publish> 
    <Publish Dialog="DataStoragePortConfig" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 

을하지만 다음 클릭에 내가 확인하고 싶은 그 속성 DataStoragePort는 빈 문자열이 아닙니다. 어떤 제안? 감사합니다 다니엘

답변

2

비어있는 마스크 편집 컨트롤은 속성을 "#"및 "?"대신 공백이있는 템플릿 문자열로 설정합니다. 예를 들어, "텍스트"가 "#####"으로 설정된 경우 빈 값은

"  "
입니다. "텍스트"가 "### - ###"로 설정된 경우 빈 값은
" - "

이 조건을 사용할 수 있습니다 :

DataStoragePort <> "  "
+0

감사합니다. 그게 좋네. 속성에서 빈 공간을 제거 할 수있는 방법이 있습니까? 사용자가 설정하는 포트는 3-4 개의 숫자 일 수 있습니다. –

+0

사용자 지정 동작 (C++ DLL 또는 VBScript)을 사용해 볼 수 있습니다. DLL에서 MsiGetProperty() 및 MsiSetProperty() 함수를 사용할 수 있습니다. VBScript에서는 Session.Property ("PROPERTY_NAME")를 사용할 수 있습니다. –

관련 문제