Installshield Environment Variables - installshield

I'm fairly new to using InstallShield, and I've ran into an issue, I'm currently creating an installer for an addon product after they accept the license agreement dialog I want InstallShield to check for a specific environment variable, if it exists store it as a string if it doesn't, show a dialog to set a path (then store it and set the variable).
The path is for the installation directory of the main product installer was built by someone else, not the addon they are installing.

I used VBScript to solve this!
Also there was a problem with environmental variables being user only and not machine.

Related

How to access the path of Inno Setup installed program from OUTSIDE of Inno Setup?

According to the docs, Inno Setup uses AppName or AppId to allow you to create an update program that will automatically put its files in the same path which the user installed the initial application to.
I need to be able to determine where Inno Setup installed files to based on AppId, but NOT from within Inno Setup. For example, I need to be able to determine this from a Python script.
One use case: patching a file in the installed program location. It would be overkill to package an entire installer just to, say, conditionally add or edit a line in a text file. A simple Python script could accomplish this, plus the user could review the script if they desired. I cannot and should not assume the user just installed to the default location, hence why I need to be able to see where the user installed the program.
Inno Setup obviously stores this somewhere since it is able to make its own patches, but I can't seem to find it in the registry. I've searched the Registry for my app ID but I only see it in the Uninstall section. I can probably pull it from there, but I think you can also create installers without uninstallers – where would this end up in that case?
The path is stored to registry to HKLM (administrative install mode) or HKCU (non administrative install mode) to a subkey named after the AppId with _is1 suffix, stored under a key SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall (as you alraedy know). The value name is Inno Setup: App Path. The path is also stored to InstallLocation with additional trailing slash, as that's where Windows reads it from. But Inno Setup reads the first value.
An example for HKLM:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\appid_is1]
"Inno Setup: App Path"="C:\\Program Files\\My Program"
"InstallLocation"="C:\\Program Files\\My Program\\"
You can see this in dozens questions, that show how to read the value in Inno Setup code. For example:
How to get path of installation of target game/application from registry when installing mod/plugin using Inno Setup?
If you create an installer what cannot be uninstalled (CreateUninstallRegKey=no or CreateUninstallRegKey=no), then the path is not store anywhere. In such case you would have to explicitly code your installer to store the path for you somewhere.

How to remove an appimage's user mofied settings after or before deleting the appimage file?

I launched an appimage using appimagelauncher. Then, I modified some settings of that app.
I know that appimages are not installed, so it can't be uninstalled. So, I deleted the appimage file.
But, when I downlaoded the appimage again, I observed that the user's previously modified settings were still there.
Now, how can I completely remove those user modified settings and launch that software as if it were newly installed?
The AppImage format doesn't define an explicit place where the applications configuration should be installed. Which means that the application can write such file wherever they please (as a regular installed application does).
Applications usually write their configurations to "$HOME/.config", you can look there for a file or folder with the application name. You can also ask the application author or check the documentation.

access application name inside custom script

I am working on an installer for the application written using electron and electron-builder. I was able to manage most of the issues but one. During uninstall process i have to remove registry key previously set outside of nsis installer. I already found a way to do that:
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "APP_NAME_GOES_HERE"
The problem i am having is, i would like to avoid hard coding the name of app and get it instead from some variable already defined by electron or electron builder.
This is how installer looks:
As you can see there is application name in a title of window KIOSKMEGA-JS and its also set at the bottom of page along with the version and its also visible in a path string. I did not define the name anywhere aside from package.json file. Which means that electron is somehow passing this name to nsis.
Does anyone know how i can access this value in my installer.nsh custom script? I tried things like $APPNAME or $NAME, without luck.
Use $(^Name) to access the standard language string set by the Name attribute in a script.
It looks like electron-builder has a define named ${PRODUCT_NAME}.

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.

How to detect whether DDS is installed in the Windows system?

I want to install OpenSplice DDS using nsis script, but i have to know whether the OpenSplice DDS installed or not in the system (Windows).
Based on the register keys how can we check if OpenSplice DDS is installed or not?
Can anybody provide the nsis script to check DDS installation based on registery keys?
A standard OpenSplice installation does not make any changes to the registry and as such, you can not use checking of the registry key to discover whether or not OpenSplice has been installed. Only if the option to install OpenSplice as a Windows service was checked during installation, information will be inserted into the registry -- just like any Windows service has an entry in the registry. Since it is up to the user to select this option or not, this is not a reliable mechanism to check for either.
A better way might be to check whether the environment variable %OSPL_HOME% is set. This variable is typically added to the environment by the OpenSplice installer; it points to its installation directory.
This answer is based on previous experience with the product. I do not have access to any current version, so the installation process might have changed.

Resources