cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
austin2359
Level 6

uninstallapplication() - default to "remove" instead of "modify"

When uninstalling, you get the options "modify," "repair" and "remove."

Does there exist any argument for the installscript function which would switch the default to "remove?"
Labels (1)
0 Kudos
(9) Replies
RobertDickau
Flexera Alumni

It probably depends on the product you're removing, what version of InstallShield it used, and the implementation of OnMaintUIBefore. For some versions, see if /removeonly does something like what you want?
0 Kudos
austin2359
Level 6

Well I have access to all the build files, so if modifying them is a solution as opposed to using a command line switch, then I could do that.
0 Kudos
austin2359
Level 6

Alright, I've searched the forums, and for the people who successfully use commands like -removeonly, it appears their preceding argument is more than just a guid in quotes. They also link to an executable.

But I'll still see if I can get it to work.
0 Kudos
RobertDickau
Flexera Alumni

Hmmm... If you use UninstallApplication, you should just need the GUID or other subkey under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall; the function looks up the UninstallString value from there and launches it. (When pointing directly to an executable, LaunchApplication is more commonly used.) Perhaps post what is or isn't happening when you call UninstallApplication?
0 Kudos
austin2359
Level 6

well this suggestion does not seem to work well in my case. every time I attempt to add arguments to make it removeonly, it fails. I've played with syntax. It fails when switching syntax from "-" to "/" and it fails having removeonly follow "uninst." it seems to give this error:

Windows ® Installer. V 5.0.7600.16385

msiexec /Option [Optional Parameter]

Install Options

Installs or configures a product
/a
Administrative install - Installs a product on the network
/j [/t ] [/g ]
Advertises a product - m to all users, u to current user

Uninstalls the product
Display Options
/quiet
Quiet mode, no user interaction
/passive
Unattended mode - progress bar only
/q[n|b|r|f]
Sets user interface level
n - No UI
b - Basic UI
r - Reduced UI
f - Full UI (default)
/help
Help information
Restart Options
/norestart
Do not restart after the installation is complete
/promptrestart
Prompts the user for restart if necessary
/forcerestart
Always restart the computer after installation
Logging Options
/l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*]
i - Status messages
w - Nonfatal warnings
e - All error messages
a - Start up of actions
r - Action-specific records
u - User requests
c - Initial UI parameters
m - Out-of-memory or fatal exit information
o - Out-of-disk-space messages
p - Terminal properties
v - Verbose output
x - Extra debugging information
+ - Append to existing log file
! - Flush each line to the log
* - Log all information, except for v and x options
/log
Equivalent of /l*
Update Options
/update [;Update2.msp]
Applies update(s)
/uninstall [;Update2.msp] /package
Remove update(s) for a product
Repair Options
/f[p|e|c|m|s|o|d|a|u|v]
Repairs a product
p - only if file is missing
o - if file is missing or an older version is installed (default)
e - if file is missing or an equal or older version is installed
d - if file is missing or a different version is installed
c - if file is missing or checksum does not match the calculated value
a - forces all files to be reinstalled
u - all required user-specific registry entries (default)
m - all required computer-specific registry entries (default)
s - all existing shortcuts (default)
v - runs from source and recaches local package
Setting Public Properties
[PROPERTY=PropertyValue]

Consult the Windows ® Installer SDK for additional documentation on the
command line syntax.

Copyright © Microsoft Corporation. All rights reserved.
Portions of this software are based in part on the work of the Independent JPEG Group.
0 Kudos
RobertDickau
Flexera Alumni

Oh, the /removeonly switch is for uninstalling through an InstallScript project's setup.exe. If it's an MSI project being removed by an InstallScript project, perhaps try argument "REMOVE=ALL", or use LaunchApplication instead?

If both installers are MSI projects, you'll probably want to define a major upgrade, instead.
0 Kudos
sandeep
Level 3

Hi there,

I'm sorry if these are naive questions - but I haven't had much luck finding a solution on these forums / documentation.

I would like the Maintenance behavior to show only Remove / Repair dialogue (with default Remove), and do a fresh installation following a 'Remove'.

I have adjusted the UI (SdWelcomeMaint) to show only Remove/Repair. I wrote my own Maint functions that read as below. I'm trying to call OnFirstUIBefore to do the installation. However, after uninstalling the application, it simply dies after running through the OnFirstUIBefore call i.e. it doesn't copy any files.

function OnMaintUIBefore()
number ret;
begin

ret = SdWelcomeMaint ("", "",REMOVEALL);
Disable(BACKBUTTON);

switch(ret)
case 302: //repair
FeatureReinstall();
case 303: //remove all
FeatureRemoveAll();
endswitch;

end;


function OnMaintUIAfter()
string szOutput;
number ret;
begin

OnFirstUIBefore();

end;


I would greatly appreciate it if anyone can help me with the following questions:

1) What do I do to make sure the installation continues after the call to OnFirstUIbefore()? On a related note, is there a better approach to force an installation?

2) How do I change the default radio-button selection To Remove (right now, nothing is selected)? I'm sure there is any easy way to do this, but I couldn't find anything intuitive. I tried calling SdWelcomeMaint with the REMOVEALL option but that doesn't seem to work.
0 Kudos
austin2359
Level 6

By the way robert, your solution worked perfectly.

You are very good at this. You see to have an answer for every question!
0 Kudos
RobertDickau
Flexera Alumni

Thanks for the kind words---onward, and good luck!

Robert
0 Kudos