NSIS scripts-Changing header text. Also using same variable in both installer and uninstaller section - text

I am writing an installer using NSIS. I wanna know how to change or write a description(text on white header)on custom pages? For eg: I am inserting a customized page after the directory page and the description remains the same i.e Choose Install Location...
But I wanna change it according to my page requirement. How should I change this text?
Also I wanna access a variable in uninstaller section which is set with some string in installer section. Please help me on this...

Okay, you seem to have two questions there.. probably best to post them separately :)
For setting the title of the customized page, simply use the following macro (I've got mine placed just prior to calling nsDialogs::Create)
!insertmacro MUI_HEADER_TEXT $(MY_CUSTOM_TITLE) $(MY_CUSTOM_SUBTITLE)
Where MY_CUSTOM_TITLE and MY_CUSTOM_SUBTITLE are variables set elsewhere.

You will need to save the string value of the variable during installation by writing it out to a file or registry setting, and then later during uninstallation reading that value from the same location.
I think you need to do this:
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "My alternate Choose Install Location text"
You could also edit the language files. This is assuming you are using MUI for your custom pages:
http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html

Related

Inno Setup - How can I change the About dialog text?

Can I change the default text in the about dialog box? Overriding the AboutSetupMessage doesn't seem to do anything:
[Messages]
AboutSetupMenuItem=&About MyApp...
AboutSetupTitle=About MyApp
AboutSetupMessage={#MyAppPublisher} version {#MyAppVersion}%n{#MyCopyright}%nhome page:%n{#MyAppURL}
Doesn't seem to matter if I edit the default.isl or use a custom ISL either. The menu item and the title change, but not the message text.
Any ideas?
There's no AboutSetupMessage.
There's AboutSetupNote. It does not change the About box message though. It's appended to it.
There's no way to change the message.
For me the AboutSetupNote did not work on Inno Setup 5.6.1 Unicode, but the TranslatorNote did.
Alternatively try TranslatorNote. This one does not change the about box message but it will append to it which is the correct application of Inno Setup license.

Choose a folder dialog for nsis

I have a problem with the skin that I am using for my nsis installer.
Is there a way to control to not apply skin to choose a folder dialog.
I am using Skincrafter plugin to apply this skin.
Generally if I load it after initializaiton, it applies to all pages/inner dialogs and child dialogs. I do not want Browse for a folder dialog to have a skin.
Can someone please provide any suggestions?
There is no way how to fix this from NSIS.
Asks the authors to add this feature for you or (if the sources are available) modify the it by yourself to fit your needs.
There are also some other skinning systems for NSIS - e.g. mine Graphical Installer (sorry for this little promo :) so you can try to use them.

How to make a single page installation wizard?

I made a python program and I compiled it using Py2exe and it works great.
As you know, all the big softwares shifted to 1-3 steps install. And many have just one page install in which they include their EULA. I found an example of this:
Image:
How to make just a single page wizard in NSIS ? Is it possible to do a single page installer like shows the above image ?
A NSIS installer is never going to be a one page wizard because the actual installing happens on a 2nd page.
There are probably two ways to create the every detail on one page wizard:
Use Resource Hacker to edit the directory page in one of the NSIS ui's in NSIS\Contrib\UIs to add a richedit control and in the script use ChangeUI to apply this new page then at run-time use one of the license plugins to fill the richedit control.
Create a custom page with nsDialogs.

nsis createting InternetShortcut not displaying icon

When I try to give custom icon while creating InternetShortcut that particulat icon is not there in created InternetShortcut. Default icon is comming.
Here is code:
WriteINIStr "$SMPROGRAMS\Launch_APP.url" "InternetShortcut" "URL" "http://localhost:9080/myapp/index.php"
WriteINIStr "$SMPROGRAMS\Launch_APP.url" "InternetShortcut" "IconFile" "$ReadmePath\A.ico"
CreateShortcut uses IShellLink to create shortcuts and is not supposed to be used to create internet shortcuts. The documented interface you are supposed to use to create internet shortcuts is IUniformResourceLocator. NSIS does not have a native instruction for this but it can be called by the system plugin using its COM syntax. To set the icon you would have to QueryInterface for IPropertySetStorage and set PID_IS_ICONFILE. In the end you are just going to end up with the same .ini file which is why a lot of examples (NSIS and other stuff) just write using the .ini API.
You could try adding IconIndex=0 to the .ini but my guess is that the icon path is wrong or icon caching is getting in the way.
Have you tried clearing the icon cache or testing on a different machine?
Thanks for using NSIS.
So - There is function CreateShortCut (nsis.sourceforge.net/Docs/Chapter4.html#4.9.3.4). it is intended to create any shortcut Windows supports. You should use it. If you find some specific case where it does not work, feel free to mail to Devs in NSIS contact list or create ticket in their bug-tracker.

How can I hide the file name when install a program?

I am using InstallShield 2010 to build the installer of my project and I would like to hide the name of files showed while they are transferred to HD:
Can I hide the file name and keep the progress bar? Or even to suppress the window and replace it by another?
Anyone have any idea about how can I do this?
You can use "SetStatusWindow" function in installscript to overcome this. An example is in InstallShield site itself: SetStatusWindow Example
To enable the display of the name and path of the file being installed on the second line of the status bar, call Enable with the INDVFILESTATUS parameter before calling FeatureMoveData.
Enable(STATUSEX);
Disable(INDVFILESTATUS);
...
SetStatusWindow(100, "Setup is complete.");
Disable(STATUSEX);

Resources