Info: Remove OS Version Check Script for msi archives

The wrapper, tools, and info you need to get games working

Info: Remove OS Version Check Script for msi archives

PostPosted by OldBoy2k » Sun Mar 02, 2008 4:33 pm

SetUp Script:
To remove OS version checks in MSI scripts,simply copy&paste the script code v1.1 into the Windows Notepad Editor and save as "RemoveOScheck.vbs".

Script Code v1.0 (old):
Code: Select all
Option Explicit

Const msiOpenDatabaseModeReadOnly = 0
Const msiOpenDatabaseModeTransact = 1

Dim argNum, argCount:argCount = Wscript.Arguments.Count
If (argCount < 1) Then
Wscript.Echo "Please supply the name of the msi file to be modified."
Wscript.Quit 1
End If

' Scan arguments for valid SQL keyword and to determine if any update operations
Dim openMode : openMode = msiOpenDatabaseModeReadOnly
openMode = msiOpenDatabaseModeTransact

' Connect to Windows installer object
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError

' Open database
Dim databasePath:databasePath = Wscript.Arguments(0)
Dim database : Set database = installer.OpenDatabase(databasePath, openMode) : CheckError

' Process SQL statements and delete the crap out of this installer!
Dim query, view, record, message, rowData, columnCount, delim, column
Set view = database.OpenView("Delete from LaunchCondition") : CheckError
view.Execute
wscript.echo "Launch Conditions Removed"
Set view = database.OpenView("Delete from InstallExecuteSequence where Action='OnCheckSilentInstall'")
view.Execute
wscript.echo "OnCheckSilentInstall step removed"
Set view = database.OpenView("Delete from Property where Property = 'ISSETUPDRIVEN'")
view.Execute
wscript.echo "Property ISSETUPDRIVEN removed"
Set view = database.OpenView("INSERT INTO Property (Property,Value) VALUES ('ISSETUPDRIVEN',1)")
view.Execute
wscript.echo "Property ISSETUPDRIVEN added"
database.Commit
Wscript.Quit 0

Sub CheckError
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then message = message & vbLf & errRec.FormatText
End If
Fail message
End Sub

Sub Fail(message)
Wscript.Echo message
Wscript.Quit 2
End Sub


Referred Original Post


To Use:
Simply drag&drop whatever msi file in windows explorer overtop RemoveOScheck.vbs.

Note: Its recommended to make backups of the msi archives before running the scripts.Its a bit of try and error which version works flawlessly.If you get install errors with Script Code 1.1 try the former Script 1.0.Sometimes the older script works better,sometimes the newer script with a specific msi installer archive.

Credits:
Many thanks goes to darkgamorck aka gamorck, the author of this script.
Last edited by OldBoy2k on Tue Mar 04, 2008 1:22 am, edited 2 times in total.
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

PostPosted by darkgamorck » Tue Mar 04, 2008 12:27 am

Hmmmm... I never imagined that this custom Doom 3 script would become quite as widespread as it has been. Anyway, oldboy2k tracked me down and asked me to make some mods, which I have done. The script now has better error checking so instead of quitting when it hits an error, it will simply skip that MSI modification and proceed to the next one. A messagebox will be displayed for each successful MSI modification made.

I've also added the mod to allow for the OS Check on the Virtual PC 2007 msi installer to be removed successfully. This is per the instructions provided by oldboy2k and since I no longer have installs of either Windows 2000 or 2003 (only XP, Vista, Ubuntu and OS X here sorry) I can't actually verify these fixes myself.

Note: I was also asked to look into the installer for the demo of Call of Duty 4: Modern Warfare. However it is quite apparent that the installer is an Installshield package wrapped like an MSI. This means that the actual commands are executed from encrypted scripts using the Installshield runtime rather than from the MSI file structures. Without installshield or some serious hacking, it will be impossible to modify the installer so that it runs without the current hackery described in the appropriate thread.

Anyway here is the code:
Script Code v1.1 (updated):
Code: Select all
Option Explicit

Const msiOpenDatabaseModeReadOnly = 0
Const msiOpenDatabaseModeTransact = 1

Dim argNum, argCount:argCount = Wscript.Arguments.Count
If (argCount < 1) Then
Wscript.Echo "Please supply the name of the msi file to be modified."
Wscript.Quit 1
End If

On Error Resume Next

' Scan arguments for valid SQL keyword and to determine if any update operations
Dim openMode : openMode = msiOpenDatabaseModeReadOnly
openMode = msiOpenDatabaseModeTransact

' Connect to Windows installer object
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError

' Open database
Dim databasePath:databasePath = Wscript.Arguments(0)
Dim database : Set database = installer.OpenDatabase(databasePath, openMode) : CheckError

' Process SQL statements and delete the crap out of this installer!
Dim query, view, record, message, rowData, columnCount, delim, column, cctr
cctr = 0
Set view = database.OpenView("Delete from LaunchCondition")
if ClearError() = false then
  view.Execute
  wscript.echo "Launch Conditions Removed"
  cctr = cctr + 1
end if
Set view = database.OpenView("Delete from CustomAction where Action='CA_CheckIfWeCanInstall'")
if ClearError() = false then
  view.Execute
  wscript.echo "Custom Action CA_CheckIfWeCanInstall Removed"
  cctr = cctr + 1
end if
Set view = database.OpenView("Delete from InstallExecuteSequence where Action='OnCheckSilentInstall'")
if ClearError() = false then
  view.Execute
  wscript.echo "OnCheckSilentInstall step removed"
  cctr = cctr + 1
end if
Set view = database.OpenView("Delete from Property where Property = 'ISSETUPDRIVEN'")
if ClearError() = false then
  view.Execute
  wscript.echo "Property ISSETUPDRIVEN removed"
  cctr = cctr + 1
end if
Set view = database.OpenView("INSERT INTO Property (Property,Value) VALUES ('ISSETUPDRIVEN',1)")
if ClearError() = false then
  view.Execute
  wscript.echo "Property ISSETUPDRIVEN added"
  cctr = cctr + 1
end if
if cctr > 0 then
  database.Commit
else
  wscript.echo "This script was unable to make changes to the specific MSI file."
end if
Wscript.Quit 0

Function ClearError
  if Err.Number <> 0 then
    Err.Clear
    ClearError = true
  else
    ClearError = false
  end if
End Function

Sub CheckError
  Dim message, errRec
  If Err = 0 Then Exit Sub
  message = Err.Source & " " & Hex(Err) & ": " & Err.Description
  If Not installer Is Nothing Then
    Set errRec = installer.LastErrorRecord
    If Not errRec Is Nothing Then message = message & vbLf & errRec.FormatText
  End If
  Fail message
End Sub

Sub Fail(message)
  Wscript.Echo message
  Wscript.Quit 2
End Sub


Note: Its recommended to make backups of the msi archives before running the scripts.Its a bit of try and error which version works flawlessly.If you get install errors with Script Code 1.1 try the former Script 1.0.Sometimes the older script works better,sometimes the newer script with a specific msi installer archive.(added by OldBoy2k)
darkgamorck
 
Posts: 1
Joined: Tue Mar 04, 2008 12:13 am

PostPosted by OldBoy2k » Tue Mar 04, 2008 1:38 am

Hi and welcome to the Win2k gaming forums,darkgamorck.Youre script update is verily welcome and thanks for the time you spend on it.Thankyou very much!

Hee, hee that VPC2007 instructions arent based on my ideas LOL the solution to fix the check is spread over the net, too:
Referred Original Post So thanks to the author for this information :)

best regards
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Info: Remove OS Version Check Script for msi archives

PostPosted by OldBoy2k » Fri Feb 06, 2009 12:33 am

Hi all,found another info related OS check entries in MSI archives:

Fixing MSI Windows Version Checks
1) Open MSI archive In Orca or SuperOca (thanks DosFrak for this application info).Select if present in the left column “CustomAction” and rename the variable “CA_ErrWrongWindowsVersion” to for example “dummy” (or delete it).

2) Next check if theres another entry "InstallExecuteSequence" in the left main column and there should be another variable “CA_ErrWrongWindowsVersion”.Also rename this variable to "dummy" (or delete it).

3) Save the MSI and try to install the application or game again.

source: Make myTV work in Windows 7

Some more notes about OS installation conditions in Media Center application setup files can be found here:
Aaron Stebner's WebLog
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Info: Remove OS Version Check Script for msi archives

PostPosted by OldBoy2k » Tue Oct 27, 2009 9:29 am

Thanks to the member adun we have another trick to deal with msi files and launch condition penetrated setups:
If present and applicable,load the MSI in Orca and edit the AbortMSI entry in the InstallExecuteSequence section.
This way the setup files get passed.
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Info: Remove OS Version Check Script for msi archives

PostPosted by OldBoy2k » Wed Dec 02, 2009 3:00 am

One other trick comes from DosFreak.Install Orca, open the msi archive and when you see a "Launch Condition" entry in the left row, right-click it -> Drop this entry to remove it.Then save the msi and try to install the application or game again.Sometimes it works if you delete the launch condition datastring instead of whole launch condition table.That needs to be tested.
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Info: Remove OS Version Check Script for msi archives

PostPosted by OldBoy2k » Wed Dec 02, 2009 3:03 am

Another possibility is to open the msi archive in Orca and to replace the launch condition string (some dits and VersionNT entries in brakets) with the following line.

Code: Select all
(VersionNT>501) OR (VersionNT=500 AND ServicePackLevel>3) OR (VersionNT=501 AND ServicePackLevel>1)


This means,the minimum operating system requirement is Windows 2000 SP4, Windows XP SP2, or Windows Server 2003.Save the msi again and try installing the application or game again.
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Info: Remove OS Version Check Script for msi archives

PostPosted by OldBoy2k » Fri Aug 27, 2010 5:30 pm

Another possible tweak:
Open the msi with Orca and select InstallUISequence table and change action InstallConditions entry Condition=1 to 0.Save and install.
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Info: Remove OS Version Check Script for msi archives

PostPosted by OldBoy2k » Fri Nov 12, 2010 11:17 am

Here's another tweak,thanks to our member justjohnny:
Install Orca, open the msi archive and you see a InstallExecuteSequence entry in the list.Click it to view and enter the action tables (opening on the right).Now right click CaCheckOS Drop this action to remove it.Also repeat the same way with table InstallUISequence if applicable.Then save the msi and try to install the application or game again.
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Info: Remove OS Version Check Script for msi archives

PostPosted by justjohnny » Wed Nov 17, 2010 11:55 am

You can work out why the MSI isn't installing by logging the install by using msiexec.

To see all the options for msiexec click Start, click Run, type in:
msiexec
and click OK. A pop up box will show you all the options for msiexec. Click OK to close.

Use msiexec in this format:
msiexec /i "<path to msi file>" /liwearucmopvx+! "<path to log file>"

An example on how to use msiexec to log an install is:
msiexec /i "C:\vs\Virtual Server 2005 Install.msi" /liwearucmopvx+! "C:\vs\vs2005install.log"

Now examine the C:\vs\vs2005install.log file to work out why your file failed to install.
justjohnny
 
Posts: 217
Joined: Mon Apr 12, 2010 7:25 am


Return to Tools & Info

Who is online

Users browsing this forum: No registered users and 0 guests

cron