cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Newmarket
Level 4

Terminal Server install mode

I can see this question has been asked a number of times, but it has never been answered. In my InstallScript MSI project I can easily determine that I'm running on a terminal server by checking the TerminalServer MSI property. Once I've done that, is there a simple way to detect whether the server is in install mode?

Thank you.
Labels (1)
0 Kudos
(10) Replies
nmsams
Level 7

I don't know if there is a flag that you can check or not, but I know that if you install from the Control Panel | Add/Remove Programs then you know for sure that you are in install mode. And you can check to see if the install is being done through the Add/Remove Programs.

there is a variable called ADDREMOVE that you can use.

For example, we have a lot of users that click the setup.exe icon and "accidentally" uninstall the product. To prevent this, I have an if statement in my onuninstall function:

if ADDREMOVE then
// uninstall
else
// display message that you must uninstall from the control panel
endif;

Hope this helps.
0 Kudos
Newmarket
Level 4

I was hoping there was a flag I could check for the mode. If a user manually puts the server into install mode with change user /install then runs the install, it should be fine. I can execute change user /query > cu.out then parse the result from the file, but that's ugly. I think I will use the ADDREMOVE variable and just tell users that they must use Add/Remove Programs to install an application on a Terminal Server since that is the recommended process. Thank you for your help.
0 Kudos
Newmarket
Level 4

Thank you, again, nmsams, for the response. Unfortunately, I implemented this solution, and it doesn't work. ADDREMOVE is ALWAYS 0 regardless of whether I run setup.exe from Add/Remove programs.

I'm using an InstallScript MSI project in IS2008. This is the code I added to OnBegin( )--I also tried it in OnFirstUIBefore( 😞
	if (!ADDREMOVE) then  
MessageBox("NOT ADDREMOVE", SEVERE);
else
MessageBox("ADDREMOVE IS DETECTED", SEVERE);
endif;


I tested on XP SP2 and Server 2003 SP1. I ran the setup by:
[LIST=1]
  • double-clicking on setup.exe
  • opening "Add or Remove Programs", clicking "Add New Programs", and clicking the "CD or Floppy" button under "Add a program from CD-ROM or floppy disk".
    In both cases I get the same result. Is there an IS2008 bug, or is ADDREMOVE not supported in InstallScript MSI?

    Thank you!
  • 0 Kudos
    nmsams
    Level 7

    It's definitly supported in Installscript MSI because that's the project type I have and I've tested it on previous versions of Installshield.

    That being said...I have not re-tested it on IS 2008 to make sure that it STILL works. It looks like I'll be doing that now just in case their is a bug with IS 2008.

    I'll let you know what I come up with.
    0 Kudos
    nmsams
    Level 7

    I'm glad you posted your problem...because now that I've retested my install on IS 2008, the ADDREMOVE flag does not seem to work for me either.

    Like I said before, my install is suppose to stop users from unistalling by simply double clicking on the setup.exe. I want them to have to go through Add/Remove programs, but just now it let me uninstall by clicking setup.exe.

    I guess I'll be putting in a support call to Macrovision.
    0 Kudos
    Newmarket
    Level 4

    Thank you, nmsams. I suppose I should do the same. Please let me know what you find out.
    0 Kudos
    nmsams
    Level 7

    I did a search of their knowledge base and Installscript MSI projects have supported ADDREMOVE since Installshield 10.

    See article Q110969.

    There was no information on them discontinuing this...
    0 Kudos
    Newmarket
    Level 4

    I opened a support incident with Macrovision. They have repro'd the issue and are investigating the problem.
    0 Kudos
    nmsams
    Level 7

    I hope you have better luck with their support than me....I entered a support incident on Dec 13 . They told me they were going to research and get back to me and I haven't heard anything yet...
    0 Kudos
    Newmarket
    Level 4

    I opened my support incident on the 13th as well. The last contact I had was on the 18th.
    0 Kudos