2014-07-25 2 views
1

오늘 이상한 문제가 발생했습니다. 파일 섹션에는 몇 가지 작업을 수행하기 위해 임시 폴더에 복사 된 두 개의 다른 .exe 파일이 있으며 설치시 사라집니다. 컴파일러가 .exe 버전을 가져 와서 다른 버전을 사용하지 않을 때까지 모두 잘 돌아갔습니다. 몇 번 다시 컴파일하고, InnoSetup에 속한 Temp 폴더 항목을 모두 지우고, PC를 다시 시작하고, 내 .exe의 새 버전을 다른 경로에 배치 한 다음 설치 프로그램에 추가했습니다.이 버전의 모든 버전을 삭제하고 새로운 하나,하지만 아무것도 도움이되지 않았다. InnoSetup은이 .exe의 다른 버전을 내가 무엇이든 취하지 않습니다.InnoSetup에서 잘못된 파일을 가져옴

그럼, 여기에 몇 가지 코드 :

[Languages] 
Name: "english"; MessagesFile: "compiler:Default.isl" 
Name: "german"; MessagesFile: "compiler:Languages\German.isl" 

[Components] 
Name: "Client"; Description: "Client"; Types: Client Full; 
Name: "Database"; Description: "Database preparation"; Types: Full; 

[Types] 
Name: "Full"; Description: "Full Installtion (Client and Database)" 
Name: "Client"; Description: "Client Only (Database needed)"; 

[Tasks] 
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; 

[Files] 
Source: "C:\MM-DISTRIBUTION\Client\Client.exe"; DestDir: "{app}"; Flags: ignoreversion 
Source: "C:\MM-DISTRIBUTION\Client\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs 
Source: "C:\MM-DISTRIBUTION\MySqlDbCreation.exe"; DestDir: "{tmp}"; Flags: dontcopy 
Source: "C:\MM-DISTRIBUTION\ClientCopyData-20140722-1208.sql"; DestDir: "{tmp}"; Flags: dontcopy 
Source: "C:\Users\d.volz\Documents\Visual Studio 2010\Projects\XMLAndIniReplacer\XMLAndIniReplacer\bin\Release\XMLAndIniReplacer.exe"; DestDir: "{tmp}"; Flags: dontcopy 

[Icons] 
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" 
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" 
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon 
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon 

[Run] 
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent 

[Code] 
var 
    DBPage: TInputQueryWizardPage; 
    Database: bool; 

procedure InitializeWizard; 
begin 
    DBPage := CreateInputQueryPage(7, ExpandConstant('{cm:DBPageHeader}'), ExpandConstant('{cm:DBPageSubHead}'), ExpandConstant('{cm:DBPageDescription}')); 
    DBPage.Add(ExpandConstant('{cm:DBPageServ}'), False); 
    DBPage.Add('Port:', False); 
    DBPage.Add(ExpandConstant('{cm:DBPageUserName}'), False); 
    DBPage.Add(ExpandConstant('{cm:DBPagePass}'), True); 

    DBPage.Values[0] := GetPreviousData(ExpandConstant('{cm:DBPageServ}'), ''); 
    DBPage.Values[1] := GetPreviousData('Port:', ''); 
    DBPage.Values[2] := GetPreviousData(ExpandConstant('{cm:DBPageUserName}'), ''); 
    DBPage.Values[3] := GetPreviousData(ExpandConstant('{cm:DBPagePass}'), ''); 

    ExtractTemporaryFile('MySqlDbCreation.exe'); 
    ExtractTemporaryFile('ClientCopyData-20140722-1208.sql'); 
    ExtractTemporaryFile('XMLAndIniReplacer.exe'); 
end; 


procedure CurStepChanged(CurStep: TSetupStep); 
var 
ResultCode : Integer; 
begin 
    if CurStep=ssPostInstall then begin 
     Exec(ExpandConstant('{tmp}') + '\XMLAndIniReplacer.exe',ExpandConstant('{app}')+'\Client.exe.config'+ ' ' +DBPage.Values[0] + ' ' + DBPage.Values[1] + ' ' + ExpandConstant('{app}')+'\Client.ini' + ' ' + ExpandConstant('{language}'),'', SW_SHOW, ewWaitUntilTerminated, ResultCode) 
    end;  
end; 

procedure CurPageChanged(CurPageID: Integer); 
begin 
    if CurPageID = wpSelectComponents then begin 
    end; 
end; 


function NextButtonClick(CurPageID: Integer): Boolean; 
    var 
    ResultCode: Integer; 
    begin 
    Result := True; 
    if CurPageID = DBPage.ID then begin 
     if DBPage.Values[0] = '' then begin 
     MsgBox('You must enter the server name or address.', mbError, MB_OK); 
     Result := False; 
     end else if DBPage.Values[1] = '' then begin 
     MsgBox('You must enter a port, even the default one.', mbError, MB_OK); 
     Result := False; 
     end else if DBPage.Values[2] = '' then begin 
     MsgBox('You must enter the user name.', mbError, MB_OK); 
     Result := False; 
     end else if DBPage.Values[3] = '' then begin 
     MsgBox('You must enter the user password.',mbError,MB_OK); 
     Result := False; 
     end else if Database then begin 
     if MsgBox('Database will now be prepared for Client. Continue?',mbConfirmation,MB_OKCANCEL) = IDOK then begin 
      if Exec(ExpandConstant('{tmp}') + '\MySqlDbCreation.exe', DBPage.Values[0] + ' ' + DBPage.Values[1] + ' ' + DBPage.Values[2] + ' ' + DBPage.Values[3] + ' ' + ExpandConstant('{tmp}') + '\ClientCopyData-20140722-1208.sql', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin 
      if ResultCode = 0 then begin 
       MsgBox('Database was created successfully. Clientcan now be installed',mbInformation,MB_OK); 
       Result := True; 
      end else if ResultCode = 1 then begin 
       if MsgBox('Could not create database for Client. Do you wish to proceed the setup anyway? Client can not be used without a database.',mbError,MB_YESNO) = IDYES then begin 
       Result := true; 
       end else begin 
       Result := false; 
       end; 
      end else if ResultCode = 2 then begin 
       if MsgBox('Could not connect to the Database. Do you wish to proceed the setup anyway? Client can not be used without a database.',mbError,MB_YESNO) = IDYES then begin 
       Result := True; 
       end else begin 
       Result := false; 
       end; 
      end else begin 
       MsgBox('Invalid number of Arguments',mbError,MB_OK); 
       Result := false; 
      end; 
      end; 
     end else begin 
      if MsgBox('Client can not be used without a prepared database. Do you wish to continue the setup anyway? ',mbError,MB_YESNO) = IDYES then begin; 
      Result := true; 
      end else begin 
      Result := false; 
      end; 
     end; 
     end; 
    end; 
    end; 

MySqlDbCreation 및 XmlAndIniReplacer 두 개의 작은 C#을 콘솔입니다.

내가 무엇을하더라도, InnoSetup은 XmlAndIniReplacer의 버전을 취해서 파일 섹션에 지정된 파일 대신에 더 이상 가지고 있지 않습니다. 또한 플래그 dontcopy를 인식하지 못합니다. 즉, 응용 프로그램 폴더에서 콘솔을 찾을 수 있습니다. 여기서 뭐가 틀린거야?

컴파일러 : InnoSetup이 버전이 변경되지 않았 음을 알아 차리지, 어딘가에 캐시에 정보를 발견하고, 이미 압축 있기 때문에 대신 사본을 캐시 시간을 절약 할 수있는 사용 나타납니다

*** Starting compile. [16:46:00] 

[ISPP] Preprocessing. 
[ISPP] Preprocessed. 

Parsing [Setup] section, line 14 
Parsing [Setup] section, line 15 
Parsing [Setup] section, line 16 
Parsing [Setup] section, line 18 
Parsing [Setup] section, line 19 
Parsing [Setup] section, line 20 
Parsing [Setup] section, line 21 
Parsing [Setup] section, line 22 
Parsing [Setup] section, line 23 
Parsing [Setup] section, line 24 
Parsing [Setup] section, line 25 
Parsing [Setup] section, line 26 
Parsing [Setup] section, line 27 
Parsing [Setup] section, line 28 
Reading file (WizardImageFile) 
    File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNIMAGE.BMP 
Reading file (WizardSmallImageFile) 
    File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNSMALLIMAGE.BMP 
Preparing Setup program executable 
Reading default messages from Default.isl 
Parsing [Languages] section, line 31 
    File: C:\Program Files (x86)\Inno Setup 5\Default.isl 
Parsing [Languages] section, line 32 
    File: C:\Program Files (x86)\Inno Setup 5\Languages\German.isl 
Parsing [LangOptions], [Messages], and [CustomMessages] sections 
    Messages in script file 
Reading [Code] section 
Parsing [Types] section, line 39 
Parsing [Types] section, line 40 
Parsing [Components] section, line 35 
Parsing [Components] section, line 36 
Parsing [Tasks] section, line 43 
Parsing [Tasks] section, line 44 
Parsing [Icons] section, line 53 
Parsing [Icons] section, line 54 
Parsing [Icons] section, line 55 
Parsing [Icons] section, line 56 
Parsing [Run] section, line 59 
Parsing [Files] section, line 47 
Parsing [Files] section, line 48 
    Reading version info: C:\MM-DISTRIBUTION\MySqlDbCreation.exe 
Parsing [Files] section, line 49 
    Reading version info: C:\MM-DISTRIBUTION\ClientCopyData-20140722-1208.sql 
Parsing [Files] section, line 50 
    Reading version info: C:\Users\d.volz\Documents\Visual Studio 2010\Projects\XMLAndIniReplacer\XMLAndIniReplacer\bin\Release\XMLAndIniReplacer.exe 
Compiling [Code] section 
Deleting ClientSetup.exe from output directory 
Creating setup files 

    Compressing: Intensifies... 

    Compressing: C:\MM-DISTRIBUTION\MySqlDbCreation.exe (1.0.0.0) 
    Compressing: C:\MM-DISTRIBUTION\ClientCopyData-20140722-1208.sql 
    Compressing: C:\Users\d.volz\Documents\Visual Studio 2010\Projects\XMLAndIniReplacer\XMLAndIniReplacer\bin\Release\XMLAndIniReplacer.exe (1.0.0.0) 
    Compressing Setup program executable 
    Updating version info 

*** Finished. [16:46:22, 00:21,809 elapsed] 
+0

업데이트했습니다. 희망은 지금 더 이해할 수 있습니다. – EaranMaleasi

+0

훨씬 좋습니다. 감사. :-)'[Files]'에있는이 행은 무엇입니까? 'Source : "C : \ MM-DISTRIBUTION \ Client \ *";'이미 그 폴더에서'Client.exe'를 포함 시켰습니다. 당신이 가지고있는 문제가 아직도 약간 불분명하다. temp에 들어가서 삭제 된 두 개의 .exe 파일을 언급하지만 "my .exe"와 ".exe"에 관해서는 계속 얘기하고 두 가지 중 하나인지는 모르겠습니다. 임시 직원이거나 다른 사람들의 한 사람인 경우. –

+0

그래,하지만 .dll과 다른 것들도 많이 배달해야한다. – EaranMaleasi

답변

2

.

수정 방법은 다음과 같습니다.

설정을 작성하십시오. 컴파일러 출력 윈도우 (보기 -> 컴파일러 출력)를 사용하여 정확히 어떤 파일이 포함되어 있는지 확인하십시오. 구문 분석 [파일]압축 : 출력 섹션을 확인해야합니다. 문제가되는 파일에 대해 사용중인 정확한 경로와 파일 이름을 기록하십시오.

설치 프로그램 스크립트의 [Files] 섹션에서 문제 파일의 이름을 변경하십시오. 설치를 다시 빌드하고 컴파일러 출력을 검사하여 파싱 할 때 이름을 바꾼 파일을 선택했는지 확인하십시오.

스크립트와 파일을 원래 이름으로 다시 변경하십시오. 원래 원하는대로 새 버전의 파일을 사용해야합니다.

관련 문제