title: InstallShield Automation can't create object
body: <p>I am working with Installshield 2014 and 2011. I'm using major upgrades and automated build scripts to handle the build. InstallShield is the stand alone build ver. for both.</p>
  
  <p>Now everything worked fine with Installshield 2011 on windows 2003 servers. I could use the automation interface to open a project, change the product code (for the major upgrade) then save it right before building the installer.</p>
  
  <p>The code for such is in a vbs file as such:</p>
  
  <pre><code>Dim oISM, oGUID
  Set oGUID = CreateObject("InstallShield.GUID")
  Set oISM = CreateObject("IswiAuto17.ISWiProject")
  
  oISM.OpenProject strInstallShieldProjectFile
  oISM.ProductCode = "{" &amp; oGUID.CreateGUID( ) &amp; "}"
  oISM.SaveProject : oISM.CloseProject : set oISM = Nothing
  </code></pre>
  
  <p>Now we've upgraded to windows 2012 servers and InstallShield 2014. I've double checked and according to InstallShield the only change needed is the ver number (17 changes to 21).</p>
  
  <p>But now nothing works. If I take the code out and put it in it's own vbs file for testing and run it, I get this:</p>
  
  <p>ActiveX component can't create object: 'InstallShield.GUID'</p>
  
  <p>Looking on google I see that's from running in 64 bit mode.... but I'm not. I'm running a cmd prompt in 32 bit mode.
  <a href="http://helpnet.flexerasoftware.com/installshield18helplib/AutomationInterface64Bit.htm" rel="nofollow noreferrer">http://helpnet.flexerasoftware.com/installshield18helplib/AutomationInterface64Bit.htm</a></p>
  
  <p>I tried calling the script with:
  %WINDIR%\SYSWOW64\cmd.exe /c cscript</p>
  
  <p>as suggested here:
  <a href="https://stackoverflow.com/questions/2806584/how-do-i-run-a-vbscript-in-32-bit-mode-on-a-64-bit-machine">How do I run a VBScript in 32-bit mode on a 64-bit machine?</a></p>
  
  <p>and other places. This did not work as I got the same error.</p>
  
  <p>I tried removing that line as I'm sure I can create a guid another way, and reran it.</p>
  
  <p>Then I got this when it tries to create the project:
  Unknown runtime error: 'CreateObject'</p>
  
  <p>Once again google came up and I checked:
  <a href="https://community.flexerasoftware.com/showthread.php?189788-Automation-error" rel="nofollow noreferrer">https://community.flexerasoftware.com/showthread.php?189788-Automation-error</a></p>
  
  <p>and couple others. I tried ensuring the dll was registered using the regsvr32 and it said it was successful. But after rerunning, it gave the same error. </p>
  
  <p>I tried directly coping the command from the InstallShield documentation to ensure no spelling mistakes but again same error.</p>
  
  <p>I even tried switching the case of the "sw" as mentioned here:
  <a href="https://stackoverflow.com/questions/22221329/installshield-automation-is-failing-while-running-vbscript-with-error-unable-to">Installshield Automation is failing while running vbscript with error unable to create object</a></p>
  
  <p>Again though, same error.</p>
  
  <p>I also tried switching to powershell as powershell is much easier to debug and read.</p>
  
  <p>The powershell code is simple and is as follows:</p>
  
  <pre><code>$oIsm =  new-object -comobject IswiAuto21.ISWiProject
  
  $oISM.OpenProject("$file")
  $oISM.ProductCode = "{" + [guid]::NewGuid() + "}"
  $oISM.SaveProject(); $oISM.CloseProject(); $oISM = $null
  </code></pre>
  
  <p>But this also does not work despite these saying it should:
  <a href="https://community.flexerasoftware.com/showthread.php?190769-Automation-using-Powershell" rel="nofollow noreferrer">https://community.flexerasoftware.com/showthread.php?190769-Automation-using-Powershell</a>
  <a href="http://blogs.flexerasoftware.com/installtalk/2011/01/getting-started-with-installshield-automation-and-powershell.html" rel="nofollow noreferrer">http://blogs.flexerasoftware.com/installtalk/2011/01/getting-started-with-installshield-automation-and-powershell.html</a></p>
  
  <p>When I use the 32 bit powershell I get this error:</p>
  
  <p>new-object : Creating an instance of the COM component with CLSID {78D393F9-76E3-438C-9CAB-6664EF5FE1F2} from the IClassFactory failed due to the following error: 
  800a801d Exception from HRESULT: 0x800A801D.</p>
  
  <p>If I run solely the vbs without a cmd prompt I also see the error of 800A801D in a pop up box.</p>
  
  <p>How can I fix this? I'd like to use powershell but a vbs fix would help as well at this point. I have tried everything I can think of and google says I'm doing it correctly (32 bit powershell/cmd, registering the dll, creating the object, etc).</p>