我们如何使用 Inno Setup 来做到这一点。
;Create Directory for Mozilla and Chrome
[Dirs]
Name: "{pf}\[Directory Name]"
Name: "{reg:HKLM\Software\Google\Chrome\Extensions,Path|{pf}\[Directory Name]}"
Name: "{reg:HKLM\Software\Mozilla\Firefox\Extensions,Path|{pf}\[Directory Name]}"
;Add Files
[Files]
Source: "Sample.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "sample@sample.com.xpi"; DestDir: "{pf}\[Directory Name]"; Flags: ignoreversion
Source: "phogkfodcfpcnalkmlcjmlnhgjacapcf\sample_chrome.crx"; DestDir: "{pf}\[Directory Name]"; Flags: ignoreversion
;Create Registry
[Registry]
Root: "HKLM"; Subkey: "Software\Google\Chrome\Extensions\mefpokegaaknljjamcdfhnimiiogmogk"; ValueType: string; ValueName: "Path"; ValueData: "{pf}\[Directory Name]\sample_chrome.crx"; Flags: uninsdeletekey
Root: "HKLM"; Subkey: "Software\Google\Chrome\Extensions\mefpokegaaknljjamcdfhnimiiogmogk"; ValueType: string; ValueName: "Version"; ValueData: "1.4"; Flags: uninsdeletekey
Root: "HKLM"; Subkey: "Software\Mozilla\Firefox\Extensions"; ValueType: string; ValueName: "sample@sample.com"; ValueData: "{pf}\[Directory Name]\sample@sample.com.xpi"; Flags: uninsdeletekey
;Run Exe file
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent