Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

InstallShield scripts on Windows 8


3 replies to this topic

dodoSturm

dodoSturm
  • Full Members
  • 14 posts

Posted 20 July 2012 - 17:31

Hi,

I'm using InstallShield 9 for a BasicMSI project. Everything works OK until I tried my installer on Windows 8 (Release Preview). Sometimes none of the InstallShield APIs are working from my custom actions.

I have a custom action (Immediate Execution) that is doing something like this:

unction StopApp(hMSI)
STRING szKey, szFileName;
STRING szAppName;
NUMBER nResult;
begin
szKey = "MSISUPPORT";
szFileName = SUPPORTDIR ^ "MSISupport.dll";
if ( StreamFileFromBinary(hMSI, szKey, szFileName) == 0 ) then
szAppName = "AppToStop.exe";
ChangeDirectory( SUPPORTDIR );
if ( UseDLL(szFileName) == 0 ) then
nResult = MSISupport.StopApp(szAppName);
SprintfMsiLog( "CUSTOM ACTION RESULT: StopAppreturned %d", nResult );
UnUseDLL(szFileName);
else
SprintfMsiLog( "CUSTOM ACTION ERROR: could not use MSISupport.dll" );
endif;
ChangeDirectory( WINDIR );
else
SprintfMsiLog( "CUSTOM ACTION ERROR: could not stream out the MSISupport.dll file" );
endif;
end;

This code works when I upgrade (minor upgrade) however it does not work when I uninstall the application. Here is what happens:

- install application. Everything OK. Restart computer.
- uninstall application in Control Panel (right click and select Uninstall)
- code is not working: StreamFileFromBinary returns error and SprintfMsiLog is not working.
- I cancel the uninstall and try again. Now evertything works correctly.... Very interesting.

In other words after system restart first attempt to uninstall my app fails. Next try will work. I tried to disable UAC but no help. If I run setup.exe again and select Remove in the maintenance box then is working.

Any ideas? I know InstallShield 9 is somehow old but I cannot change and use a later version.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 July 2012 - 18:29

Does a log file give any additional information?
Are you sure that your script gets called at all? (insert a MessageBox at the beginning). If I recall correctly, IS 9 used DCOM for communication between the MSI process and the InstallScrippt engine process. This caused some problems and has been changed in later versions.
Do you really need to use InstallScript to call the dll function? Can't you call it as a DLL custom action?

dodoSturm

dodoSturm
  • Full Members
  • 14 posts

Posted 23 July 2012 - 11:05

Hi,

The log file does not have any additional information, there everything looks OK. Just as an info SprintfMsiLog does not work too.
The custom action is called, I have a MessageBox there that is visible when uninstall.
I really need StreamFileFromBinary because I need to run some other executables during uninstall.
Yes, possible that this has to do with DCOM, I remember I have to workaround a problem there in the past.
I think this is a security problem, when I run setup.exe and then select "Remove" in the maintenance dialog then it's working. What I need in this case is equivalent of "Run as administrator" option when running an executable.
When I cancel the uninstallation in the middle and start again then everything is working!! So maybe a call somewhere makes the whole InstallScript engine working, question is which one.

Dorel Sturm
Germay


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 July 2012 - 13:45

I don't know.
You could try this with an evaluation copy of the latest InstallShield version to see if that fixes the problem. In this case it could indicate indeed a problem with DCOM or some other issue that has been fixed. Of course this won't help much if upgrading your InstallShield isn't an option - however I'd say it's not the best idea to use a 9 year old tool to target the next version of Windows.