2017-07-31 2 views
0

私はウィンドウアプリケーションで作業しています。私はこのアプリケーション用のセットアップを作成するためにinstallshieldを使用しています。それまではすべて正常に動作しています。私はどのマシンでもセットアップをインストールできます。特定のコンピュータドメインのみに対してinstallshieldを使用してセットアップを作成してください

問題:私は私の組織では、我々は、このセットアップは、このドメイン上で実行することができるだけでしょうaaa.comのドメインを使用していると仮定すなわち、特定のドメインのための私のセットアップを制限するセキュリティ理由

詳細情報が必要な場合はお知らせください。

+0

インストールする前に、ドメインをレジストリでチェックすることはできますか? – XAMlMAX

+1

ok、私はあなたの答えを調べて、それが動作するかどうかお知らせください。 – Sunny

答えて

0

これは選択肢の1つです。
レジストリからドメイン名を取得するには、あなたのために仕事をします。
私はその程度までInstallShieldを使用していませんが、方法を説明するthis linkが見つかりました。私はからコードを掲載しています参考
は、ウェブサイトはここに言った:

Public blnResult 
Public strDomain 
Public strFQDomain 
Public objRootDSE 

blnResult = BindToAD 
If Not blnResult Then 
WScript.Quit(False) 
End If 

Function BindToAD() 
Dim blnResult_Bind 

BindToAD = False 

On Error Resume Next 
Set objRootDSE = GetObject("LDAP://RootDSE") 
If (Err.Number <> 0) Then 
Exit Function 
End If 

strDomain = objRootDSE.Get("DefaultNamingContext") 
If (Err.Number <> 0) Then 
Exit Function 
End If 

'// Shouldn't ever be true if no error was returned, but... 
If Len(strDomain) = 0 Then 
Exit Function 
End If 

blnResult_Bind = GetFQDNFromNamingContext(strDomain, strFQDomain) 
If blnResult_Bind Then 
BindToAD = True 
Else 
If (Err.Number <> 0) Then 
Exit Function 
End If 
End If 

On Error Goto 0 
End Function 


'// --------------------------------------------------------------------------------- 
'// GetFQDNFromNamingContext 
'// Purpose: Converts a Naming Context into a DNS name 
'// Input: strNamingContext e.g. DC=Domain,DC=Company,DC=com 
'// Output: FQDN for strNamingContext e.g. Domain.Company.com 
'// Returns: True/False 
'// 
'// Notes: LDAP allows for commas in strings, as long as they are escaped with a \ character. 
'// e.g. "CN=Lewis\, Chris" 
'// Since commas are not allowed in domain names, there is no parsing for them here. 
'// --------------------------------------------------------------------------------- 
Function GetFQDNFromNamingContext(ByVal strNamingContext, ByRef strFQDN) 
Dim arrDomain 
Dim intCount 
Dim strTemp 

GetFQDNFromNamingContext = False 

'// Parse the NC by creating an array with the comma as an array boundry 
arrDomain = Split(strNamingContext, ",") 

For intCount = 0 To UBound(arrDomain) 
'// Add a "." if needed 
If Len(strTemp) > 0 Then 
strTemp = strTemp & "." 
End If 

'// Remove the "DC=" and add this item to the temp string 
strTemp = strTemp & Mid(arrDomain(intCount), 4) 
Next 

strTemp = Replace(strNamingContext,"DC=","") 
strTemp = Replace(strTemp,",",".") 

'// Return the FQDN 
GetFQDNFromNamingContext = True 
strFQDN = strTemp 
End Function 
0

基本的には、早期のカスタムアクションでセットアップのドメイン名を取得するプロパティを設定し、立ち上げにそのプロパティを使用する必要があります調子。これは、現在のドメイン名を得ることについて、いくつかの答えを持っています

Get the domain name of a computer from Windows API

しかし、これは多くの場合、アプリケーションでうまく機能テストの一種です。インストール時テストとは、ユーザーがドメインをインストールしてからドメインに参加してアプリを実行できないことを意味します。また、ユーザーがドメインに参加し、アプリケーションをインストールしてからドメインを離れることもできます(ラップトップを持っていても構いません)。だからあなたが言及している "セキュリティの理由"は何ですか?ドメインメンバシップがアプリケーションの要件である場合は、アプリケーションにランタイムチェックを追加して、どこにでもインストールを実行させます。

+0

あなたの返信のために@PhilDWありがとうございました。セットアップを安全にする最良の方法は、許可されたメンバーだけがインストールまたは使用できることを意味します。あなたの貴重な助言や提案を常に歓迎します。 – Sunny

+0

私の提案は、私が言及した理由のためにアプリケーションにドメインチェックを入れることであり、リンクは使用するコードの種類を示しています。 – PhilDW

関連する問題