Jump to content
  • Advertisement
Sign in to follow this  

MSI Packages + Using VBScript to detect 64-bit

This topic is 3930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I got a weird issue with my MSI installer. We're using InstallShield Express to build our setup, and while the MSI package it generates is perfectly working, I'm having issues with detecting 32-bit / 64-bit machines. I wrote a small VBScript which checks the Windows Registry for the CPU architecture and based on the architecture, it'll remove either the 32-bit or the 64-bit executable from the installer. What I do is during initialization of the installer, I have a VBScript which does this:
On Error Resume Next

Set WshShell = CreateObject("WScript.Shell")

OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
Session.SetInstallLevel(0) ' Needed to re-calculate the installers requirements
Set Db = Session.Database

' Delete either the 32-bit or the 64-bit installation option, based on the current CPU Architecture
If (OsType = "x86") Then
	Set Vw = Db.OpenView("DELETE FROM `Feature` WHERE `Feature`.`Feature` = 'NewFeature4'") ' 64-bit option removed
	Call Vw.Execute
	Call Vw.Close
	Call Db.Commit
	'Call MsgBox("Removed 64-bit option")
	Set Vw = Db.OpenView("DELETE FROM `Feature` WHERE `Feature`.`Feature` = 'NewFeature5'") ' 32-bit option removed
	Call Vw.Execute
	Call Vw.Close
	Call Db.Commit
	'Call MsgBox("Removed 32-bit option")
End if
' Let's re-calculate all install settings and make our changes propagate

The script itself works fine. The 64-bit option doesn't show up when I'm running the installer. HOWEVER, after completing the installation, I see both the 32-bit and the 64-bit helper files(Which have different names), and I end up with the 64-bit EXE and DLL. In other words, it installs both executables, and the 64-bit end up being written last, thus overwriting the 32-bit files. When I rename my 64-bit files to name64.exe and name64.dll, I end up with both files. Any idea what's going on here? I appears to update the database, yet still installs both features. Toolmaker

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!