NSIS installer like loader - nsis

For my project i need to do next:
Install Silverlight
Install XAP file
Run XAP file
It takes only 3 minutes, no configuration, just click-and-install
I would like to hide all controlls (progress bar, buttons, log list). Just logo and gif loading animation. All steps to create installer was done, so now i need to know could i do such customization or not?

Create simple NSIS installer with SILENT flag.
Use Exec to execute Silverlight and XAP installation (also in quiet mode) and filanne use ShellExecute to open a XAP file.

I am not sure if you want to hide silverlight's buttons or your one.
Silverlight: try quiet mode: /q.
Your: that long story, we need your NSIS code first.

Related

Inno Setup - How to change the icon of the shortcut of uninstaller without separate icon file?

Is it possible to change the icon of the uninstaller shortcut in the Start menu without storing a separate icon file (to the app folder)?
I see this: Using Resource Hacker for changing the icon after the build, but I cannot implement it.
My code:
[Icons]
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
An icon of a Windows shell shortcut can be set by an external icon file (what you do not want) or by the file the shortcut points to. So you have to modify the icon of the uninstaller.
You have to modify the uninstaller icon on a compile time.
You cannot do this on install time, as the uninstaller includes its own checksum. If you modify the uninstaller, it with refuse to start, claiming it is corrupted. Unless you find out how to also fix the checksum stored in the uninstaller.
But Inno Setup does not really allow modifying the uninstaller icon on a compile time.
What you can do, is to abuse the SignTool "callback". The command set to SignTool processes even the uninstaller. And it can actually do anything with the uninstaller, not only "sign" it. But it has to "sign" it in any case (Inno Setup explicitly checks that the executable was signed after the "tool" finishes).
You can achieve that by setting SignTool to a batch file (or other script) that will run the actual signtool.exe in the end, but before that, it will modify the icon (e.g. using Resource Hacker command-line).
For an example of such batch file that both modify the uninstaller and signs it, see Microsoft SmartScreen - suspended using Inno Setup installer?
So this is doable, only if you do code signing (what you should anyway). You need a code signing certificate for that.
Disclaimer: Adding a shortcut to an uninstaller to Start menu is against Windows guidelines (and creating Start menu groups is against Windows guidelines for Windows 8 and above at least).

For InstallShield, How can I get a path from the user by browsing the computer?

I am packing a plugin for another program, thus I need to get the path of the pre-installed program (proe 4.0) and set an environment with it.
Now I used "Requirement" function in InstallShield to search the file of proe 4.0.
The problem is, this "search" function cannot find the install directory in some of the conditions, such as in a nonstandard installation.
I want to show a dialog with a browse button and a text box to allow the user to define the installation directory themselves. How can I do that?
I found the solution which is very easy for advanced users: use a script project, and in the setup vbs script you can find everything you want.

Inno Setup and the Windows UAC shield

I am stuck at some UAC issue (I guess).
My question is: What does this UAC Shield Icon on some applications mean? And how would I get this icon to my Inno Setup setup.exe?
Inno Setup installers require Admin Privileges by default (if not customized by installer creator). UAC popup will be triggered if user did not change UAC settings in Windows.
http://www.jrsoftware.org/ishelp/index.php?topic=setup_privilegesrequired
[Setup]: PrivilegesRequired
Valid values:
none, poweruser, admin, or lowest
Default value:
admin
Description:
The effect of this directive depends on which version of Windows the user is running:
As others have said, Inno Setup requires administrator privileges by default, and will trigger the UAC prompt. You can change that with PrivilegesRequired. The problem with this is that it doesn't show the shield icon on the executable.
The best way to do it is to use the Microsoft's Manifest Tool and change the manifest embedded in the executable. It is usually included in Microsoft SDKs, which are free to download from Microsoft. Once you install it, the Manifest Tool is usually located in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\bin\mt.exe. Note that some SDKs don't include it. I also found it in https://github.com/eladkarako/mt, if you don't want to install the SDK.
To extract the manifest from the executable, execute this in the command line: "path to mt.exe" -inputresource:"path_filename.exe";#1 -out:"path_filename.exe.manifest"
Now change asInvoker to requireAdministrator in path_filename.exe.manifest (manifest files are actually XMLs, so you can edit them with a text editor)
To put the manifest into the executable: "path to mt.exe" -manifest "path_filename.exe.manifest" -outputresource:"path_filename.exe";1
There you go! The executable now has the shield icon no matter what!
There's another method, which is far less useful. You can change the executable to run as administrator in the registry (same as right clicking it --> Properties --> Compatibility --> checking Run as Administrator on). To do this, create a string value that has the name set as the path+filename of the executable, and contains the data/text RUNASADMIN; the value has to be created in:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers if you want to change it for the current user
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers if you want to change it for all users (this usually requires you to have administrator privileges)
The problem with it is that it doesn't carry over if you move the executable (you have to do it all over again) or give it to someone else (they have to do it, or have to run some tool to do it). This is not useful.

How to disable font registration installscript MSI projects in installshield?

I have a Installscript MSI project, and I want to disable Global Font Registration inside Install Shield. How can I do this ?
I just have some font files that i copy them to Hard disk where i setup my application but it creates a key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts.
I dont want it to happen.
There are two ways as far as I've found.
If you have a paid version of InstallShield you can use this method:
http://helpnet.installshield.com/installshield18helplib/mergedProjects/installshield18langref/LangrefDisable00000677.htm
Or, if your application loads font dynamically (like we do, with QT), just rename your font file(s) to .font or something else and then readd them to your setup project. InstallShield won't recognize them as a font and therefore won't register the files.
If you really need them to have the .ttf extension, I would suggest you set a custom action (a .js script for instance) that renames the font file(s) after installation to ttf.
I hope this helps
Cheers

How can I selectively delete a Start Menu folder with NSIS?

I am using NSIS to create install and uninstall wizards to my rather simple app for Windows.
The situation is, my NSIS script creates a shortcut to the app in the Start Menu folder for the installation wizard. So far no problem. Other apps (related with mine) install their shourcts in the same Start Menu Folder too.
The problem is in the uninstall process. I can delete my shortcuts without a problem but, what about of the folder in the Start Menu? I cannot delete it if there are apps alredy there but I would like it to be removed if the folder is empty.
How can I check using the NSIS script if the folder is empty and therefore condition if the deletion of the folder has to happen or not?
Although is not vital I don't like to have empty useless folders cluttering my Start Menu view.
Thank you very much in advance!
Julen.
RMDir "$SMPrograms\yourfolder" will only delete the folder if it is empty

Resources