Inno setup InnoSetup获取错误的文件
今天我遇到了一个奇怪的问题。 在文件部分,我有两个不同的.exe文件,它们被复制到temp文件夹中做一些事情,然后在安装时消失。所有这些都很好地工作,直到编译器接受了my.exe的一个版本,并决定不再接受它的任何其他版本。我重新编译了几次,删除了所有属于InnoSetup的临时文件夹条目,重新启动电脑,将新版本的.exe放到另一个路径并添加到安装程序中,我甚至删除了所有版本的.exe并创建了一个新的,但没有任何帮助。InnoSetup拒绝接受此.exe的其他版本,无论我做什么 那么,这里有一些代码:Inno setup InnoSetup获取错误的文件,inno-setup,Inno Setup,今天我遇到了一个奇怪的问题。 在文件部分,我有两个不同的.exe文件,它们被复制到temp文件夹中做一些事情,然后在安装时消失。所有这些都很好地工作,直到编译器接受了my.exe的一个版本,并决定不再接受它的任何其他版本。我重新编译了几次,删除了所有属于InnoSetup的临时文件夹条目,重新启动电脑,将新版本的.exe放到另一个路径并添加到安装程序中,我甚至删除了所有版本的.exe并创建了一个新的,但没有任何帮助。InnoSetup拒绝接受此.exe的其他版本,无论我做什么 那么,这里有一些代
[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,这意味着我可以在应用程序文件夹中找到控制台。这里怎么了
编译器:
*** 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]
InnoSetup似乎正在某个缓存中查找信息,注意到版本没有更改,并使用该缓存副本,因为它已经被压缩,可以节省时间 这里有一个解决方法: 建立你的设置。使用“编译器输出”窗口(查看->编译器输出)查看包含的文件。您应该检查该输出的解析[文件]和压缩:部分。请注意问题所在文件的确切路径和文件名 重命名问题文件,包括它所在的文件夹和安装程序脚本中的[Files]部分。再次构建安装,并检查编译器输出,以确保在解析重命名文件时它拾取了该文件
将脚本和文件更改回其原始名称。它现在应该开始使用您最初想要的文件的新版本。更新了它。希望它现在更容易理解。好多了。谢谢。:-)
[Files]
中的这一行应该做什么<代码>来源:“C:\MM-DISTRIBUTION\Client\*”您已经从该文件夹中包含了Client.exe
。也有点不清楚你有什么问题。你提到了两个进入temp的.exe文件,然后被删除,但接着又谈到了“my.exe”和“the.exe”,我不知道是这两个文件中的一个进入temp,还是其他文件中的一个。是的,但是有一大堆.dll和其他东西也必须交付。然后列出它们。我认为,*
的工作方式与您认为的不一样,如果是这样的话,您可以删除Client.exe的单独一行。正如您所看到的,这两行都进入临时文件夹,但问题是,InnoSetup使用的替换程序不是我在“文件”部分中指定的。向导要求主可执行文件和其他文件。我想我可以相信它;)