2014-11-11 6 views
1

내 설치/제거 스킨이 링크에서 제공되는 VCL 스타일을 사용하고 삭제할 수 없습니다 삭제되지 않았습니다.InnoSetup : <a href="https://code.google.com/p/vcl-styles-plugins/wiki/VCLStylesInnoSetup" rel="nofollow noreferrer">https://code.google.com/p/vcl-styles-plugins/wiki/VCLStylesInnoSetup</a></p> <p>하지만 프로그램의 함수가 포함 된 DLL을 제거 할 때입니다 : DLL을 제거

어떻게 삭제할 수 있습니까?.

나는이 대안에 대해 생각해 보았습니다. dll을 임시 폴더에 복사하고 Windows 클리너가 나중에 삭제해야하는 임시 dll을로드하십시오. 그러나이 문제는 제가이 게시물에서이 문제에 관해 이야기 할 수 있습니다 : https://stackoverflow.com/questions/26863987/innosetup-pascalscript-filecopy-doesnt-copy 하지만 그것은 또 다른 문제입니다, 내가 여기서 알고 싶은 것은이 dll 파일을 삭제할 수있는 방법입니다. 내가 파일을 삭제하려고 경우

이 내가 사용하고 전체 [Code] 섹션의 DeinitializeUninstall 방법을주의 사항 :

// Import the LoadVCLStyle function from VclStylesInno.DLL 
procedure LoadVCLStyle(VClStyleFile: String); external '[email protected]:unins000.dll stdcall setuponly'; 
procedure LoadVCLStyle_UnInstall(VClStyleFile: String); external '[email protected]{app}\unins000.dll stdcall uninstallonly'; 

// Import the UnLoadVCLStyles function from VclStylesInno.DLL 
procedure UnLoadVCLStyles; external '[email protected]:unins000.dll stdcall setuponly'; 
procedure UnLoadVCLStyles_UnInstall; external '[email protected]{app}\unins000.dll stdcall uninstallonly'; 

function InitializeSetup(): Boolean; 
begin 
    ExtractTemporaryFile('unins000.vsf'); 
    LoadVCLStyle(ExpandConstant('{tmp}\unins000.vsf')); 
    Result := True; 
end; 

procedure DeinitializeSetup(); 
begin 
    UnLoadVCLStyles; 
end; 

function InitializeUninstall: Boolean; 
begin 
    Result := True; 
    LoadVCLStyle_UnInstall(ExpandConstant('{app}\unins000.vsf')); 
end; 

procedure DeinitializeUninstall(); 
begin 
    UnLoadVCLStyles_UnInstall; 
    DeleteFile(ExpandConstant('{app}\unins000.dll')); 
end; 

답변

2

당신은 삭제하기 전에 라이브러리를 언로드 할 필요가있다. 이를 위해 UnloadDLL 함수를 사용하십시오 (이 도움말에는이 경우에 대한 예제가 포함되어 있습니다). 누락되면 코드에서 DeleteFile 함수가 실패합니다. 제거 프로그램에서 다음과 같이 대신 작성하십시오.

procedure LoadVCLStyle_UnInstall(VClStyleFile: String); external '[email protected]{app}\unins000.dll stdcall uninstallonly'; 
procedure UnLoadVCLStyles_UnInstall; external '[email protected]{app}\unins000.dll stdcall uninstallonly'; 

function InitializeUninstall: Boolean; 
begin 
    Result := True; 
    LoadVCLStyle_UnInstall(ExpandConstant('{app}\unins000.vsf')); 
end; 

procedure DeinitializeUninstall(); 
begin 
    UnLoadVCLStyles_UnInstall; 
    UnloadDLL(ExpandConstant('{app}\unins000.dll')); 
    DeleteFile(ExpandConstant('{app}\unins000.dll')); 
end;