Install Shield 2009 - Shortcuts creation - installation

Is it possible to create shortcuts in Install Shield 2009 based on user input?
In essnes, a shortcut will be created (on the desktop) only if the user (who runs the installation) wants to do so

We have a screen that prompts the user to create desktop and quicklaunch shortcuts.
The shortcuts are then each in individual components with a condition set to only install if the checkbox was selected.
You also should store this response in the registry somewhere, and read it back during a reconfigure, upgrade, repair, etc. Otherwise if the checkboxes were on by default and that screen does not display to the user, the condition will evaluate to true (because the default property is true) and although the shortcut was not initially installed, it will be created during the repair if the components condition is reevaluated.

I do something similar to Sacha, but I'm lazier. ;-)
I create a component for each desktop shortcut (I hate software that assumes it's allowed to dump shortcuts on my desktop); no file in the component. Then I assign each of these components to its own feature. Then I can use standard feature selection dialogs (which is built in automatically and used when the user selects a Custom installation) to let the user select the desktop shortcut features.
I don't see a lot of software installers offering to install optional shortcuts in the feature selection dialog, but it strikes me as a natural place to do it. More technical users may see this as mixing metaphors.
FWIW, I originally did this in an InstallScript/MSI project, and I've just done the exact same thing in a straight MSI project, and the technique works fine in both.

It's been a while since I've used installshield, my company is currently using WISE as an installer; however, it should be possible to do what you are asking.
In general installer terms you need to do the following:
Make a screen for your installer that presents the option to create the shortcut, this screen should have the prompt text and a checkbox.
There should be a mechanism for storing the response of the checkbox in an Installshield property.
During the execution phase, use the reponse to trigger the creation of the shortcut.
I don't know about the capabilities of Installshield 2009 for whether this can be done without editing the script itself.
I hope this helps.

Related

How can I abort a Windows Installer using VB Script?

How can I abort a Windows Installer using VB Script that when it choose a certain option, the installer will force end?
I am using Visual Studio 2010 Setup Project:
Here is the pseudocode for it:
MSGBOX "Do you want to continue installing?"
IF Press YES { Continue Installing }
If Press NO { Abort/Exit the installation process. }
End
I expect this final window to appear after I press NO:
It might help if you said something about what the incorrect option is. It might be something in a dialog (like TextBoxes) that you've added to the UI and you can't validate it because VS setups have no support for custom actions to run during the UI to validate entered data.
Either way, all custom actions in VS setups run after all the files are installed and the setup is virtually complete. In other words the only place to validate your data is after the install has finished when it's too late to stop the installation. All you can do is return an error from the VB Script and have the whole setup abort and roll back, and I don't think that's what you want.
If you really need this kind of functionality you need a tool that has support for it, somewhere in the dozens of tools that can create MSI files.
In a more functional tool I don't think you'd use a dialog choice like that. The dialog that offered the choice would have a custom action validate the data when the Next button is clicked. If the data is incorrect then the Next button stays disabled. If it is potentially incorrect a warning can appear on the dialog, but there is a Cancel-type button on every install dialog I've seen, so you don't need to abort anything - tell the user to cancel. But most dialogs have a back button to go back and change data too. In other words your UI flow isn't typical of most wizard-type flows in installs and therefore could be confusing.

How to implement custom UAC privilege UI?

When deleting a file in Windows Explorer (Windows 7), if admin privileges are required to delete the file, this dialog is displayed:
Is there a way to achieve this kind of effect in my app?
Currently I am launching a process 'as administrator' to perform the same sort of action (replacing a file rather than deleting it), so the user is shown the generic UAC dialog, asking:
"Do you want to allow the following program to make changes to this computer?"
Is the kind of helpful UI shown by Explorer (as opposed to the generic UAC dialog) possible in a 3rd party app?
I'm guessing no, since it would allow 3rd parties to elevate privileges in a sneaky way.
Use Button_SetElevationRequiredState to add the shield to the button. When the user pushes the button, use the COM elevation moniker to create the helper object.
The default setting on Windows 7 is for most system components to not show the UAC dialog.
If you change your setting to always prompt, you will see that clicking Continue in the Explorer dialog would create the normal UAC prompt.
As a non-system binary, your code would always prompt except at the most lenient UAC setting (never prompt.)

Is there a way to install software that prompts for privilege escalation(UAC) programmatically?

Basically I either need to Click the UAC button with my program(which i don't believe is possible) or somehow make it so I don't need to click the button to install the software. I will also need to click buttons during the install with my program but I know how to do that. I am only concerned with the UAC things.
One way or the other, the user is going to have to click that button to give you permission to proceed. That's the whole point of UAC, if there were a way to work around it, it would serve absolutely no purpose.
You can either ask for permission sooner (at the beginning of your installation) or later (at the point in the installation when the privileges are first actually required), but you have to do it one of those times.
The standard course of action is to embed a manifest in your application that indicates you require administrative privileges. The applicable line looks like this:
<requestedExecutionLevel level="requireAdministrator" />
Alternatively, you could choose to rely on UAC's "Installer Detection" functionality:
The first application compatibility technology that is part of UAC is called Installer Detection. Because most installers write binaries to the Program Files directory, they overwhelmingly need administrator privileges. Installer Detection is designed to scan the name and the resources of the EXE to determine whether an application is an installer. For example, an executable would be marked as an installer if the executable name or description contained the strings "install" or "setup". So an application named setup.exe, without an application manifest, would trigger a UAC elevation if launched by a token without administrator privileges.
Clicking buttons during your install isn't a very good idea, either. If this is an installer that you're writing, code in some "silent install" flags that you can specify when executing the installer app. If this is a third-party installer that you're using, check the documentation; chances are such flags already exist. The point of these flags is that interactive UI is not displayed at all during setup, meaning that no one has to bother clicking any buttons (which is very hard to get right).
you can install your program in the user's home directory or any other directories which is writable without administrator privilege.
if you're writing an installer wrapper, you can ask for UAC on the wrapper and the wrapper can start the real installer(s) with administrator privilege. Most installers also provides command line options for unattended installations, so you might want to check those instead of scripting button clicks.
You can't click button on UAC consent dialog.
Your other options depend on what you really try to achieve. So give us more details on the your task: there could be better design choices than clicking installer buttons from an application.
To avoid UAC, you can install a service which will start the installation. But user has to consent when you install the service.

How to disable cut, copy, paste, rename, etc from the Windows Registry?

I'm trying to create a software in VB.Net as my uni project to disable the following from a Windows 7 pc. I think they have to be disabled from the context menu of the Windows Registry, but instead of disabling the whole context menu, I'd like to disable the following individually.
Cut, copy, paste, rename, delete, open, print, share, create shortcut, open with, send to, new, properties.
I want to give users the option of disabling them selectively/individually via checkboxes so those options will be disabled in the right-click of a mouse.
My problem is I don't know which is the right key to disable as the registry is so huge & some keys are similiarly named.
Could anyone help me to say what are the exact key locations of the above-mentioned right-click functions in the Windows Registry or how to go about this ?
The deep flaw in the assumptions made in this question is that the context menu is configured by registry entries. It is not. Windows allows modifying a window's context menu by sending the WM_CONTEXTMENU message. Code, not config. If you are not happy with the default implementation of that message then you subclass the window procedure and provide your own message handler for that message so you can display your own context menu. This is core to the way Windows works.
Modifying the context menu of a program you didn't write is possible too but much more complicated. You use SetWindowsHookEx() to inject a DLL into the other process. You cannot write a DLL like that in VB.NET, it requires native code. Because that process won't have the CLR loaded to run your managed code.

How can I use standard WiX to create a streamlined installer experience?

Background:
Currently, we have created a wizard by WiX UI. The user should click next, next and next...
But suddenly, we found that there's nothing should be interacted with user, user just need keep clicking next. So..
Here is the desired behavior:
We automatically switch to the next dialog page after all the stuff (such as pre-check and so on) done in the current page. Once there are errors in installation process, we show the error page to the user. That makes for a streamlined installer experience for the user. One click, everything done.
Can WIX do this kind of stuff purely, or should I need some other work to do to implement this?
No, you'll need to define your own external UI handler (like the MS Office installer does) if you want something "fancy" - why not just remove the UI altogether? We do this for a number of setups....
Take a look at WixUI_Mondo, WixUI_Minimal and other predefined UIs that come with WiX. Otherwise you can define your own dialogs and their sequence.
You can try with Wix_minimal or you can go for your own customized dialog boxes.
You can also customize the sequences of the dialog boxes by your own need. I suggest you to do the second option.

Resources