我想通過修改源代碼Inno Setup Compiler 5.5.9 Unicode
來使我的Inno Setup Script創建uninstaller.exe
文件進行卸載,而不是unins000.exe
。在Inno Setup中通過編輯Install.pas Delphi單元重命名「unins000.exe」
我打開Delphi單元Install.pas
具有這些代碼:
procedure GenerateUninstallInfoFilename;
var
ExistingFiles: array[0..999] of Boolean;
BaseDir: String;
procedure FindFiles;
var
H: THandle;
FindData: TWin32FindData;
S: String;
begin
H := FindFirstFile(PChar(AddBackslash(BaseDir) + 'unins???.*'),
FindData);
if H <> INVALID_HANDLE_VALUE then begin
repeat
S := FindData.cFilename;
if (Length(S) >= 9) and (CompareText(Copy(S, 1, 5), 'unins') = 0) and
CharInSet(S[6], ['0'..'9']) and CharInSet(S[7], ['0'..'9']) and CharInSet(S[8], ['0'..'9']) and
(S[9] = '.') then
ExistingFiles[StrToInt(Copy(S, 6, 3))] := True;
until not FindNextFile(H, FindData);
Windows.FindClose(H);
end;
end;
procedure GenerateFilenames(const I: Integer);
var
BaseFilename: String;
begin
BaseFilename := AddBackslash(BaseDir) + Format('unins%.3d', [I]);
UninstallExeFilename := BaseFilename + '.exe';
UninstallDataFilename := BaseFilename + '.dat';
UninstallMsgFilename := BaseFilename + '.msg';
end;
我想改變這個代碼來創建uninstaller.exe , uninstaller.dat , uninstaller.msg
文件時,設置保存卸載信息。
因此,如果安裝程序檢測到舊uninstaller.exe
試圖重新安裝程序而無需卸載任何其舊的安裝時,安裝程序應檢測到舊uninstaller.exe
和覆蓋它無需任何用戶確認。
使用的編譯器:CodeGear RAD Studio with Delphi 2009 Update 4
。
我想知道我該怎麼做,我只會做這個測試的目的。
重命名後的unins000.exe
到uninstaller.exe
,貌似創新安裝找不到卸載日誌文件或任何其他錯誤.........
謝謝你的幫助。
可能還有更多相關的代碼。你有沒有考慮聘請程序員,或者學習編程自己。程序員將能夠理解代碼並知道如何改變它。很明顯,您希望通過刪除編號邏輯來進行重大更改。 –
但@DavidHeffernan請...........我會嘗試瞭解你告訴我有關更改此代碼.....我也嘗試將'unins'重命名爲'uninstaller',但我仍然像'uninstaller000.exe'一樣在最後得到三位數字。我怎樣才能刪除'000/001/002 ............ 999'? – GTAVLover
首先閱讀代碼。你明白它的作用嗎?你想如何改變編號邏輯?請記住,您已經省略了許多相關的代碼。我建議你不要太努力。 –