When using Inno Setup to create an installation script, you may encounter errors when running the program after the DLL is not registered and the installation is complete.
After a series of searches, the solution is finally found.
The Code is as follows:
[Files]
Source: "DLL file path"; destdir: "{app}"; flags: ignoreversion regserver
Source: "DLL file path"; destdir: "{app}"; flags: regtypelib
Code parsing:
Among them, flags: The regserver parameter of the segment is registration
The run section is redundant.
Version ignored by ignoreversion
Regserver registers ActiveX dll/OCX
Regtypelib registration Type Library TLB
Restartreplace if the file is replaced by a restart
The error message is not displayed when the noregerror registration fails.
Replacesameversion to replace the same version
When uninsnosharedfileprompt is uninstalled, the file sharing prompt is not displayed.
Set sharedfile as a shared file
Set sharedfile as a shared file"
Example:
You have developed a xxx.dll. you used this DLL in the first software soft.exe and shared it in the package. The first installation test count is increased by 1.
The second soft2.exe software is also used, so the shared count is two.
Both software are installed on one machine. When one software is uninstalled, the shared count is reduced by one. Because the additional count is not 0, the DLL will not be uninstalled, when every two software programs are uninstalled, the count has reached 0, indicating that no software in the system has used this DLL, And the uninstall program will unmount this DLL.