Using innosetup

Hi,
I have been succesfully using innosetup to install my windows apps on Windows PCs.

But since last year, at the botttom of the build-script I get these warnings:

Warning: The [Setup] section directive “PrivilegesRequired” is set to “admin” but per-user areas (userdesktop) are used by the script. Regardless of the version of Windows, if the installation is running in administrative install mode then you should be careful about making any per-user area changes: such changes may not achieve what you are intending. See the “UsedUserAreasWarning” topic in help file for more information.

Warning: Constant “pf” has been renamed. Use “commonpf” instead or consider using its “auto” form.

Now, the script (at present innosetup-6.2.0) I have been using all these years is this (I set to Bold the two offending constants); unfortunatelly the [Run] section shows up bold: Anyway:

[Setup]
AppName=myappname
AppVerName=myappname 2.2.9
AppPublisher=mySoftware
AppPublisherURL=https://mywebsiteaddress
AppSupportURL=https://mywebsiteaddress
AppUpdatesURL=https://mywebsiteaddress
DefaultDirName={pf}\myappname 2.2.9
DefaultGroupName=myappname 2.2.9
VersionInfoVersion=1
AppId={{AF8A018F-2DB4-4932-91B6-4A644DF4C694}
AllowNoIcons=yes
OutputBaseFilename=myappSetup
Compression=lzma
ChangesAssociations=yes
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
MinVersion=10.0.15063

[Tasks]
Name: “desktopicon”; Description: “{cm:CreateDesktopIcon}”; GroupDescription: “{cm:AdditionalIcons}”; Flags: unchecked
Name: “quicklaunchicon”; Description: “{cm:CreateQuickLaunchIcon}”; GroupDescription: “{cm:AdditionalIcons}”; Flags: unchecked

[Files]
Source: “myappname Win\myappname.exe”; DestDir: “{app}”; Flags: ignoreversion
Source: “myappname Win*”; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: “myappname Win\myappname Libs*”; DestDir: “{app}\myappname Libs”; Flags: ignoreversion recursesubdirs createallsubdirs
Source: “myappname Win\myappname Resources*”; DestDir: “{app}\myappname Resources”; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: “{group}\myappname”; Filename: “{app}\myappname.exe”
Name: “{group}{cm:UninstallProgram,myappname}”; Filename: “{uninstallexe}”
Name: “{userdesktop}\myappname”; Filename: “{app}\myappname.exe”; Tasks: desktopicon

[Run]
Filename: “{app}\myappname.exe”; Description: “{cm:LaunchProgram,myappname}”; Flags: nowait postinstall skipifsilent

Now, about Warning 1: "The [Setup] section directive “PrivilegesRequired” is set to “admin”.
But since my script does not contain such directive, I assume such directive is a default one. (I looked to the “UsedUserAreasWarning” topic in help file, but I did not get any light).
And about Warning 2: Constant “pf” has been renamed. Use “commonpf” instead or consider using its “auto” form.

Accordingly I made the two required changing like this :
[Setup]
DefaultDirName={commonpf}\myappname 2.2.9
[Icons]
Name: “{{admin}\myappname”; Filename: “{app}\myappname.exe”; Tasks: desktopicon

Now, although the new build-script runs without showing any warning and the .exe gets installed all right, I’d like to know from people more expert than me if the two changings are actually OK, or if I should modify them in a better way. Thank you.

Another old “problem” is that after installing my apps, when I click the Start button, at the top of the list of apps I see the “icons” of my newly installed apps, but running down the list, my apps appear as “a generic folder” while all the other apps show their icon.
Should I add anything else in the above script in order to see my apps-icon instead of the folder?
Suggestion welcome! Thank you.

Seems like you should be asking this question on stackoverflow.

PrivilegesRequired indeed defaults to admin. That means it will install for all users on the machine. As such, you should not be using userdesktop because it refers to the desktop folder of the user running the installer, but does not make changes to any of the other users on the machine. In admin mode, the correct constant to use is commondesktop. This is the shared desktop folder whose contents appear to all users on the machine.

There’s a good chance you don’t need admin mode at all. You could use

PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog

To allow the user to choose the install mode. In that case instead of userdesktop you would use autodesktop which will switch between userdesktop and commondesktop as necessary. Similar constants exist for other directories such as program files. You can find the list of constants at Inno Setup Help.

2 Likes

I had these issues when creating my latest program with Xojo. My old program was a 32-bit, and I also updated it to a 64-bit program.

This is what I changed it to when using a 64-bit executable:

DefaultDirName={commonpf64}\\{#XojoAppName}   

Here is my run script with the redistribution file:

[Run]
Filename: "{tmp}\\VC_redist.x64.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing 64-bit Windows Universal runtime..."; Flags: waituntilterminated
Filename: "{app}\\{#XojoAppName}.exe"; Description: "{cm:LaunchProgram,{#XojoAppName}}"; Flags: nowait postinstall skipifsilent

Edit: Here is what I added for the desktop icon:

Name: "{commondesktop}\Hz Injection"; Filename: "{app}\\{#XojoAppName}.exe"; WorkingDir: "{app}"; IconFilename: "{app}\\HwI256.ico"

Maybe this helps?

Since it seems that everybody does not mind having the folder containing the app itself, I made peace with myself and stopped fretting about it. Thank you for answering.

In fact using commondesktop and replacing pd with commonpd no warning shows up anymore. Thank you for your suggestion.

Yes, using commonpf or commonpf64 helped in having a clean built (i.e. without warnings).

As for the

Even adding an .ico file did not help in removing the folder.

Then, reading the innosetup’s “group” help-item, I realized that, as far as I understood it, one cannot avoid having the folder. What it seems strange to me, is that although the Icon section contains:
Name: “{group}{cm:UninstallProgram,Psalms and Ragas}”; Filename: “{uninstallexe}”

yet no “Uninstall myApp” item is added in that folder; something that in the old old past, if my recollection is right, used to be there. In such case the folder at least contained two items (the app-icon to open the app, and the uninstall command). But I may be wrong.
Thank you for your suggestions.

Hi @Carlo_Rubini,

I believe that there could be an issue with InnoSetup, as I can’t seem to create a commonprograms link and a group link at the same time. When I add them individually, here is what I am able to see.

Group icons:

Name: {group}\{#XojoAppName}; Filename: {app}\{#XojoAppName}.exe; WorkingDir: {app}; IconFilename: {app}\HwI256.ico
Name: {group}\{#XojoAppName} Uninstall; Filename: {uninstallexe}

Innogroup

This next one is commonprograms:

Name: {commonprograms}\{#XojoAppName}; Filename: {app}\{#XojoAppName}.exe; WorkingDir: {app}; IconFilename: {app}\HwI256.ico
Name: {commonprograms}\{#XojoAppName} Uninstall; Filename: {uninstallexe}

InnoCommonPrograms

Is this what the computer is showing?

Edit: For clarification, the icons installed are: HWI, and HWI Uninstall

Hi @Eugene_Dakin ,
Sorry, but I do not know what commonprogrmas are.
Anyway, from the time I started compiling 64bit installers I no more see the HWI Uninstall item. I only get the HWI item (i.e. for my app I only get Psalms and Ragas).
Using Innosetup 6.2.2.

I tried various combination in the AppName etc. strings:

AppName=Psalms and Ragas
AppVerName=Psalms and Ragas 2.2.9
DefaultDirName={commonpf}\Psalms and Ragas 2.2.9// or only Psalms and Ragas
DefaultGroupName=Psalms and Ragas 2.2.9// or only Psalms and Ragas

and in the Icon section, following the prompt in Innosetup Help > Icon-group:

Name: {group}{Psalms and Ragas}; Filename: {app}{Psalms and Ragas.exe}
Name: {group}\Uninstall Psalms and Ragas"; Filename: {uninstallexe}

or
Name: {group}{Psalms and Ragas}; Filename: {app}{Psalms and Ragas.exe}
Name: {group}\Psalms and Ragas Uninstall"; Filename: {uninstallexe}

or
Name: “{group}\Psalms and Ragas”; Filename: “{app}\Psalms and Ragas.exe”
Name: “{group}{cm:UninstallProgram,Psalms and Ragas}”; Filename: “{uninstallexe}”

I also tried to add 2.2.9 to the above various Psalms and Ragas (i.e. Uninstall Psalms and Ragas 2.2.9 and so on).

Bottom line: I never get the Uninstall item as I see in your screen-shots. While, as I said, I used to get it 20 years ago when using “cm.UnistallProram,Psalms and Ragas”.
Next I’m going to try some older Innosetup version supporting 64bits and see what happens.
Regards.

Hello Carlo,

Here are some suggestions that may help with the iss script…

The above script will install the 32-bit application in the Program Files (x86) directory, and make a folder called “Psalms and Ragas”.

Place the following script in the [Icons] section:

Name: {group}\{#AppName}; Filename: {app}\{#AppName}.exe; WorkingDir: {app}
Name: {group}\{#AppName} Uninstall; Filename: {uninstallexe}

Maybe this will show the uninstall icon?

Hello Eugene,

so, after building a 32bit version of the app and removing from the script the 64bits architecture references, this is what I did.

#define AppName “Psalms and Ragas”
#define AppVerName “Psalms and Ragas 2.2.9”

[Setup]
AppName={#AppName}
AppVerName={#AppVerName}
DefaultDirName={commonpf}{#AppName}
DefaultGroupName={#AppName}
etc.
[Icons]
Name: {group}{#AppName}; Filename: {app}{#AppName}.exe; WorkingDir: {app}
Name: {group}{#AppName} Uninstall; Filename: {uninstallexe}

but unfortunatelly “uninstall” does not show up.

Meantime I spent several hours testing with previous versions of Innosetup, and I found that version 6.0.5, with [Icons] set as the one below worked erratically. I mean sometime clicking the Start buttton uninstall shows up, sometimes after showing up after a second it disappears, and sometimes (usually) it does not show up at all.
[Icons]
Name: “{group}\Psalms and Ragas”; Filename: “{app}\Psalms and Ragas.exe”; ; WorkingDir: {app}
Name: “{group}{cm:UninstallProgram,Psalms and Ragas}”; Filename: “{uninstallexe}”

Would you terribly mind testing the original 64bit app on your PC and see what happens?
https://www.asram.org/downloads/PsalmsRagasSetup.exe
The Innosetup [Icon] section is the “old” one:
[Icons]
Name: “{group}\Psalms and Ragas”; Filename: “{app}\Psalms and Ragas.exe”; WorkingDir: “{app}”
Name: “{group}\Uninstall Psalms and Ragas”; Filename: “{uninstallexe}”
Name: “{commondesktop}\Psalms and Ragas”; Filename: “{app}\Psalms and Ragas.exe”; WorkingDir: “{app}”; Tasks: desktopicon

Meanwhile I thank you very much for your efforts helping me. Regards.

Hello Carlo,

I worked on your program and created an installer package that works well. The new installer creates a folder, and adds an icon for the executable and the uninstaller, and also adds an icon to the desktop. Below is a screen grab of my menu when installed.

NewInstaller

Here is the innosetup script that was used:


#define XojoAppName  "Psalms and Ragas"
; XojoAppPath is the path to the executable
#define XojoAppPath  "C:\test\Psalms and Ragas 2.2.9"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{ED70BB94-A8F5-454E-9B3F-94E57C05189D}
AppName={#XojoAppName}
AppVersion={#XojoAppName} 2.2.9
AppPublisher=Carlo Rubini
AppPublisherURL=https://www.asram.org
AppSupportURL=https://www.asram.org
AppUpdatesURL=https://www.asram.org
DefaultDirName={commonpf64}\\{#XojoAppName}   
DefaultGroupName={#XojoAppName}
OutputBaseFilename=PsalmsRagasSetup
SetupIconFile=C:\test\Psalms and Ragas 2.2.9\Psalms and Ragas Resources\toblaIcon.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "{#XojoAppPath}\\{#XojoAppName}.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#XojoAppPath}\\{#XojoAppName} Libs\\*"; DestDir: "{app}\\{#XojoAppName} Libs"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#XojoAppPath}\\{#XojoAppName} Resources\\*"; DestDir: "{app}\\{#XojoAppName} Resources"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#XojoAppPath}\\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\\Program Files\\Xojo\\Xojo 2022r4.1\\Extras\\Windows Runtime\\Installers\\VC_redist.x64.exe"; DestDir: {tmp}

[Icons]
Name: {group}\{#XojoAppName} ; Filename: {app}\{#XojoAppName}.exe;WorkingDir: {app}; IconFilename: {app}\toblaIcon.ico
Name: {group}\{#XojoAppName} Uninstall; Filename: {uninstallexe}
Name: {commondesktop}\{#XojoAppName} ; Filename: {app}\{#XojoAppName}.exe; WorkingDir: {app}; IconFilename: {app}\toblaIcon.ico

[Run]
Filename: "{tmp}\\VC_redist.x64.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing 64-bit Windows Universal runtime..."; Flags: waituntilterminated
Filename: "{app}\\{#XojoAppName}.exe"; Description: "{cm:LaunchProgram,{#XojoAppName}}"; Flags: nowait postinstall skipifsilent

Here is the link to download the installer:
PsalmsRagasSetup

Let me know if this works on the computer.

1 Like

Hi, unfortunatelly the link generates an error. Regards,

An error occurred during a connection to www.mediafire.com. PR_END_OF_FILE_ERROR

Error code: PR_END_OF_FILE_ERROR

I zipped the setup file to make it easier to download. Here is the updated link:

Unzip the file to show the exe, and run the exe file to install.

Warm regards.

the original link

or

generates the same error on the Mac (Safari); and Firefox says it is not a secure connection.
On the PC, Edge after a while tells me Mediafire closed the connection.

Let me find another place to upload it…

Try this google drive link:
https://drive.google.com/file/d/1M8RRTVpfT2wwRl8FW-REHli_D3m-OS5k/view?usp=sharing

Hi,
this time I got the .zip file, but unfortutately, even if I could see that windows runtime were loading, in the Start menu “uninstall” does not show.
So I compiled the script of your last post, adding the Windows Runtime, but once installed the app did not show its "uninstall’ menu.

My opinion is that my old Lenovo laptop, although running the last Windows 10 update, is the culprit. That’s why I had sent you a link to my website.

But anyway, at this point I feel I’m abusing too much of your kindness and patience. Please have my sincerest thanks and best regards. Sorry for having wasted so much of yuor time.

1 Like

I don’t get (or want) an uninstall item in the Start menu when I use InnoSetup with a very basic script, but Innosetup always puts an uninstaller in the application’s folder, and if I go to the Windows Uninstall Programs control panel it’s always able to find the uninstaller - it just works. For me this is ideal, and transparent to users.

3 Likes

But what about the users? I guess they expect it when the app shows up as a folder.