핸디소프트/일일일~2013. 10. 31. 13:34

- win7, win8 에서  클라이언트의 *.htx, *.hwx 파일이 XSviewer.exe 로 열리지 않는 현상이 관찰되어


  인스톨쉴드(버전 X) 스크립트로 해당 확장자에 대해 XSviewer.exe 로 연결시킴


- 설치완료 후엔 레지스트리에 다음과 같이 추가된다

HKEY_CLASSES_ROOT\.htx

HKEY_CLASSES_ROOT\.hwx

HKEY_CLASSES_ROOT\htx.Document

HKEY_CLASSES_ROOT\hwx.Document


- 참고로 아래 부분은 On END 쪽에 넣으면 설치완료후 확인창이 나오지 않기에 OnFirstUIAfter() 쪽에 넣고 메시지박스로 출력하도록 조정


- 위의 OnFirstUIAfter() 쪽에 넣으면 특정 파일들 (dll ) 이 레지스트리에 등록이 되지 않아 OnMoved() 로 변경

 : 참고로 onMoved() 는 설치할 파일이 PC에 복사되고 난 후 실행되는 부분


prototype NUMBER    MakeAssociation(STRING, STRING,STRING);

prototype NUMBER    MakeAssociationEx1(STRING, STRING,STRING);

prototype NUMBER    MakeAssociationEx2(STRING, STRING,STRING);



////////////////////////////////////////////////////////////////////////

//                                                                    //

//  확장자, 확장자 아이콘 등록  함수                                 //

//  Function:   MakeAssociation                                       //

//                                                                    //

//  Purpose:    Creates a file association in the Registry.  Use      //

//            this function for Explorer shell only, as it will       //

//            not create the extra application identification keys,   //

//            which are necessary for Program Mananger shell.         //

//            For Program Manager shell, you can use the script-      //

//            based function MakeAssociationEx.                       //

//                                                                    //

//  Parameters:                                                       //

//      szApp:    String with full path to the executable to be       //

//                associated with the file extension.                 //

//                                                                    //

//      szExtension:  String with the extension to be associated      //

//                with an application.  Must include the preceding    //

//                period (for example:  ".txt")                       //

//                                                                    //

//      szIcon :   String with full path to the executable to be      //

//                associated with the file Icon                       //

//                                                                    //

//                                                                    //

////////////////////////////////////////////////////////////////////////


  

function MakeAssociation(szApp, szExtension, szIcon)

BOOL      bResult;

NUMBER    nResult;

STRING szOpen;

begin

  RegDBSetDefaultRoot ( HKEY_CLASSES_ROOT );

  //bResult = RegDBKeyExist(szExtension);

  //if (bResult = TRUE) then

//    nResult = AskYesNo ("Warning the extension " + szExtension + " is already registered. Overwrite?", YES);

//    if (nResult = NO) then

//       return -1;

//    endif;

//  endif;

  LongPathToShortPath (szApp);

  szApp = szApp + " \"%1\"";

  szOpen = "open" + " \"%1\""; 

  RegDBCreateKeyEx (szExtension, "");

  

  RegDBCreateKeyEx (szExtension + "\\DefaultIcon", "");

  RegDBSetKeyValueEx (szExtension + "\\DefaultIcon","", REGDB_STRING, szIcon, -1);

  RegDBCreateKeyEx (szExtension + "\\shell", "");

  RegDBCreateKeyEx (szExtension + "\\shell\\open", "");

  RegDBCreateKeyEx (szExtension + "\\shell\\open\\command", "");

  RegDBSetKeyValueEx (szExtension + "\\shell\\open\\command", "", REGDB_STRING, szApp, -1);

  

  //RegDBCreateKeyEx (szExtension + "\\shell\\open\\ddeexec", "");//추가

  //RegDBSetKeyValueEx (szExtension + "\\shell\\open\\ddeexec", "", REGDB_STRING, szOpen, -1);//추가

  

  return 0;

end;


////////////////////////////////////////////////////////////////////////  


function MakeAssociationEx1(szApp, szExtension, szName)

BOOL      bResult;

NUMBER    nResult;

STRING    svKeyName;


begin

  RegDBSetDefaultRoot ( HKEY_CLASSES_ROOT );


  StrSub ( svKeyName , szExtension , 1 , 3 );

  svKeyName = svKeyName + ".Document";


//  bResult = RegDBKeyExist(szExtension);

//  if (bResult = TRUE) then

//    nResult = AskYesNo ("Warning the extension " + szExtension + " is already registered. Overwrite?", YES);

//    if (nResult = NO) then

//       return -1;

//    endif;

//  endif;


  LongPathToShortPath (szApp);

  szApp = szApp + " \"%1\"";

  RegDBCreateKeyEx (szExtension, "");

  RegDBSetKeyValueEx ( szExtension , "" , REGDB_STRING , svKeyName , -1 );


  RegDBCreateKeyEx (svKeyName, "");

  RegDBSetKeyValueEx ( svKeyName , "" , REGDB_STRING , szName , -1 );

  RegDBCreateKeyEx (svKeyName + "\\shell", "");

  RegDBCreateKeyEx (svKeyName + "\\shell\\open", ""); 

  RegDBCreateKeyEx (svKeyName + "\\shell\\print", ""); 

  RegDBCreateKeyEx (svKeyName + "\\shell\\open\\command", "");

  //RegDBCreateKeyEx (svKeyName + "\\shell\\print\\command", "");

  RegDBSetKeyValueEx (svKeyName + "\\shell\\open\\command", "", REGDB_STRING, szApp, -1);

  //RegDBSetKeyValueEx (svKeyName + "\\shell\\print\\command", "", REGDB_STRING, szApp, -1);


  return 0;

end;  //End of function MakeAssociationEx


////////////////////////////////////////////////////////////////////////


function MakeAssociationEx2(szApp, szExtension, szName)

BOOL      bResult;

NUMBER    nResult;

STRING    svKeyName;


begin

  RegDBSetDefaultRoot ( HKEY_CLASSES_ROOT );


  StrSub ( svKeyName , szExtension , 1 , 3 );

  svKeyName = svKeyName + ".Document";


//  bResult = RegDBKeyExist(szExtension);

//  if (bResult = TRUE) then

//    nResult = AskYesNo ("Warning the extension " + szExtension + " is already registered. Overwrite?", YES);

//    if (nResult = NO) then

//       return -1;

//    endif;

//  endif;


  LongPathToShortPath (szApp);

  szApp = szApp + " \"%1\"";

  RegDBCreateKeyEx (szExtension, "");

  RegDBSetKeyValueEx ( szExtension , "" , REGDB_STRING , svKeyName , -1 );


  RegDBCreateKeyEx (svKeyName, "");

  RegDBSetKeyValueEx ( svKeyName , "" , REGDB_STRING , szName , -1 );

  RegDBCreateKeyEx (svKeyName + "\\shell", "");

  RegDBCreateKeyEx (svKeyName + "\\shell\\open", ""); 

  RegDBCreateKeyEx (svKeyName + "\\shell\\print", ""); 

  //RegDBCreateKeyEx (svKeyName + "\\shell\\open\\command", "");

  RegDBCreateKeyEx (svKeyName + "\\shell\\print\\command", "");

  //RegDBSetKeyValueEx (svKeyName + "\\shell\\open\\command", "", REGDB_STRING, szApp, -1);

  RegDBSetKeyValueEx (svKeyName + "\\shell\\print\\command", "", REGDB_STRING, szApp, -1);


  return 0;

end;  //End of function MakeAssociationEx2


///////////////////////////////////////////////////////////////////////////////


function OnMoved()

begin         

MakeAssociation(TARGETDIR ^ "\\bin" ^ "XSViewer.exe", ".htx",TARGETDIR ^ "\\bin" ^ "XSViewer.exe,0" );

MakeAssociation(TARGETDIR ^ "\\bin" ^ "XSViewer.exe", ".hwx",TARGETDIR ^ "\\bin" ^ "XSViewer.exe,0" );

MakeAssociationEx1(TARGETDIR ^ "\\bin" ^ "XSViewer.exe", ".htx",TARGETDIR ^ "\\bin" ^ "XSViewer.exe,0" );

MakeAssociationEx1(TARGETDIR ^ "\\bin" ^ "XSViewer.exe", ".hwx",TARGETDIR ^ "\\bin" ^ "XSViewer.exe,0" );

MakeAssociationEx2(TARGETDIR ^ "\\bin" ^ "XSViewer.exe /p", ".htx",TARGETDIR ^ "\\bin" ^ "XSViewer.exe,0" );

MakeAssociationEx2(TARGETDIR ^ "\\bin" ^ "XSViewer.exe /p", ".hwx",TARGETDIR ^ "\\bin" ^ "XSViewer.exe,0" );

//MessageBox ("HANDY Groupware 클라이언트가 설치 완료 되었습니다.", INFORMATION);


end;



Posted by 배터리
핸디소프트/일일일~2009. 8. 28. 12:45


InstallShield 로 작업중에 한 사이트로부터 해당 프로그램이 구동하는 서버 주소를 신뢰된 사이트에 등록해달라고 함.

찾아보니 registy 쪽을 살짝 추가해주면 됨.

예) *.handysoft.co.kr 을 추가해야할 경우
---------------------------------------------------------------------------------------------------------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\handysoft.co.kr]
까지 폴더 생성후 New DWORD Value 로 추가하여 다음과 같은 키값 생성 "http"=dword:00000002
---------------------------------------------------------------------------------------------------------------
위와 같은 형태로 추가해주면 된다

예) bbs.test.com
---------------------------------------------------------------------------------------------------------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\test.com]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\test.com\bbs]
까지 폴더 생성후 New DWORD Value 로 추가하여 다음과 같은 키값 생성 "http"=dword:00000002

예) 123.123.123.1
---------------------------------------------------------------------------------------------------------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range99]
까지 폴더 생성후 New DWORD Value 로 추가하여 다음과 같은 키값 생성 "http"=dword:00000002
                        New String Value 로 추가하여 다음과 같은 키값 생성 ":Range"="10.40.17.26"
---------------------------------------------------------------------------------------------------------------
Range숫자 // 부분은 사용자가 원하는대로 추가

Posted by 배터리