Question

I have a DLL and OCX pack then I've decided to make an installer.

This is what I have:

ArchitecturesInstallIn64BitMode=x64

[Files]
Source: {syswow64}\*; DestDir: {syswow64}; Flags: onlyifdoesntexist
Source: {sys}\*; DestDir: {sys}; Flags: onlyifdoesntexist


[Run]

Filename: regsvr32.exe; Parameters: """{sys}\zlib1.dll"" /S"; StatusMsg: Registrando: zlib1.dll; Flags: RunHidden WaitUntilTerminated

Filename: regsvr32.exe; Parameters: """{syswow64}\actskin4.ocx"" /S"; StatusMsg: Registrando: actskin4.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Bassmod.dll"" /S"; StatusMsg: Registrando: Bassmod.dll; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\ChamaleonButton.ocx"" /S"; StatusMsg: Registrando: ChamaleonButton.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.Calendar.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.Calendar.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.Codejock.TaskPanel.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.Codejock.TaskPanel.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.CommandBars.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.CommandBars.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.Controls.Unicode.v13.2.1.ocx"" /S"; StatusMsg: Registrando: Codejock.Controls.Unicode.v13.2.1.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.Controls.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.Controls.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.DockingPane.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.DockingPane.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.Markup.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.Markup.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.PropertyGrid.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.PropertyGrid.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.ReportControl.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.ReportControl.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.ShortcutBar.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.ShortcutBar.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.SkinFramework.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.SkinFramework.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Codejock.SyntaxEdit.v13.4.0.Demo.ocx"" /S"; StatusMsg: Registrando: Codejock.SyntaxEdit.v13.4.0.Demo.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\HookMenu.ocx"" /S"; StatusMsg: Registrando: HookMenu.ocx; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\MSCOMCTL.OCX"" /S"; StatusMsg: Registrando: MSCOMCTL.OCX; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\MSCOMCTL32.OCX"" /S"; StatusMsg: Registrando: MSCOMCTL32.OCX; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\Msvbvm50.dll"" /S"; StatusMsg: Registrando: Msvbvm50.dll; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\msvcr71.dll"" /S"; StatusMsg: Registrando: msvcr71.dll; Flags: RunHidden WaitUntilTerminated
Filename: regsvr32.exe; Parameters: """{syswow64}\zlib1.dll"" /S"; StatusMsg: Registrando: zlib1.dll; Flags: RunHidden WaitUntilTerminated

I've seen the regserver parametter but I'm not sure how it works (I've readed the parametter documentation), I need to know if I can simplify the things by doing only this without needing all the [RUN] section?:

[Files]
Source: {syswow64}\*; DestDir: {syswow64}; Flags: onlyifdoesntexist regserver
Source: {sys}\*; DestDir: {sys}; Flags: onlyifdoesntexist regserver

And also If I do that then I still need to specify the "ArchitecturesInstallIn64BitMode"? for the correct registration of the first x64 dll?

UPDATE:

Maybe this is a better equivalent of the [RUN] section:

[Files]
Source: {syswow64}\*; DestDir: {syswow64}; Flags: onlyifdoesntexist regserver 32bit
Source: {sys}\*; DestDir: {sys}; Flags: onlyifdoesntexist regserver 64bit
Was it helpful?

Solution

The more correct approach would be:

[Files]
Source: C:\yourdlls\x86\*; DestDir: {sys}; Flags: onlyifdoesntexist regserver 32bit
Source: C:\yourdlls\x64\*; DestDir: {sys}; Flags: onlyifdoesntexist regserver 64bit; Check: IsWin64

Note that I've changed the Source dir. That is because it is an amazingly bad idea to source files from your own Windows folder, and even worse to do so with wildcards. You're just asking for something that will completely destroy someone else's Windows installation if you attempt that.

(Also note that you should never install to {syswow64}, especially when using regserver. The lines above will have the same effect of installing into two separate folders but they will actually register things correctly, unlike what you had.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top