Rabu, 25 Desember 2013

Inno Installer, How to Register OCX files on Vista and Win 7



I am using InnoInstaller to create an install package for my app. On Windows XP everything works like a charm,, but when a user is installing the application on Vista or Win 7 the installer fails to install and register ocx files (I am primarily referring to 64 bit Vista and Win 7)

Specifically the issue is with RichTX32.ocx, ComDlg32.ocx and mswinsck.ocx

Can someone point out what is wrong with my installer script or help me resolve this. I found that when users MANUALLY go to register files they actually have to disable UAC on their machine,, register the files and then enable UAC back.



Code:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "MyApp"
#define MyAppVerName "MyApp 1.0.0"
#define MyAppPublisher "Me The Publisher"
#define MyAppURL "http://www.MyApp.com/"
#define MyAppExeName "MyApp.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
PrivilegesRequired=admin
AppId={{806496F8-EA6A-4533-BAFC-4AF3F2D42F3A}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\Program Files\Me The Publisher\{#MyAppName}
DisableDirPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputDir=D:\My Documents\MyAppINNOINSTALLER
OutputBaseFilename=MyApp
SetupIconFile=D:\Install\Install\icon.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "D:\Install\Install\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Install\Install\icon.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Install\Install\Data\*"; DestDir: "{app}\Data\"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall
Source: "D:\Install\Install\Support\*"; DestDir: "{app}\Support\"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

; begin VB system files
; (Note: Scroll to the right to see the full lines!)
Source: "D:\Install\Support Files\stdole2.tlb";  DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regtypelib
Source: "D:\Install\Support Files\msvbvm60.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Install\Support Files\oleaut32.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Install\Support Files\olepro32.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Install\Support Files\asycfilt.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile
Source: "D:\Install\Support Files\vbscript.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Install\Support Files\msxml6.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Install\Support Files\BtnPlus1.ocx";   DestDir: "{sys}"; Flags: uninsneveruninstall noregerror regserver
Source: "D:\Install\Support Files\FraPlus1.ocx";   DestDir: "{sys}"; Flags: uninsneveruninstall noregerror regserver
Source: "D:\Install\Support Files\RICHTX32.OCX";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Install\Support Files\MSWINSCK.OCX"; DestDir: "{sys}"; Flags: onlyifdoesntexist regserver restartreplace sharedfile
Source: "D:\Install\Support Files\MSWINSCN.OCX"; DestDir: "{sys}"; Flags: onlyifdoesntexist regserver restartreplace sharedfile
Source: "D:\Install\Support Files\MSCOMCTL.OCX";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Install\Support Files\COMDLG32.OCX";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
; end VB system files



[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\Support\vbrun60sp6.exe";
Filename: "{app}\Support\mysql32.msi"; Flags: shellexec
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent


suber : http://www.vbforums.com/showthread.php?607811-Inno-Installer-How-to-Register-OCX-files-on-Vista-and-Win-7

0 komentar:

Posting Komentar