Innosetup - problem putting icon on uninstaller in start menu - windows-10

I'm using Innosetup for a very simple Windows C++ app. It just has an icon for the main EXE in the start menu group, plus another icon for the uninstaller (unins000.exe, created by Innosetup).
In the [Files] section of the script is:
Source: "C:\...\telecine.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\...\Telecine.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\...\uninstall.ico"; DestDir: "{app}"; Flags: ignoreversion
and in the [Icons] section:
Name: "{autoprograms}\Nightshade Arts\Telecine\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\Telecine.ico"
Name: "{autoprograms}\Nightshade Arts\Telecine\Uninstall"; Filename: "{app}\unins000.exe"; IconFilename: "{app}\uninstall.ico"
What works: the two entries are in the program group, the shortcut to Telecine.exe has the Telecine.ico icon next to it, the shortcut to the uninstaller works.
Problem: the uninstaller icon is not the one in uninstall.ico, it is something else, probably contained in unins000.exe itself.
Not sure what has gone wrong. uninstall.ico is there is the app directory, and it contains the right icon. Just doesn't show up.
Not sure where I've gone wrong?

Related

Inno Setup Using Variable in [icon] and [Registry] [duplicate]

This question already has an answer here:
Using global string script variable in Run or other section in Inno Setup
(1 answer)
Closed 11 months ago.
I am new to Inno Setup.
I have defined a few global variables in the [code] section.
I want to make use of it in [icons], [Files], and [Registry]
My start menu would depend on a few conditions. To simplify, I will derive where the shortcuts will be created and store the full path in the variable.
Assuming I have set the following Path in the code section.
CustomStartMenu:='C:\Users\Rajendra\AppData\Roaming\Microsoft\Windows\Start Menu\Programs';
I would like Inno Installer to create all the shortcuts based on the variable CustomStartMenu
[Icons]
Name: "{#CustomStartMenuPath}\MyApp"; Filename: "{app}\myApp.exe"; WorkingDir: "{app}"; IconFilename: "{app}\myapp.ico"; IconIndex: 0
Another Example
variable DotPaintAppPath
[Files]
Source: "c:\myplugin.exe"; DestDir: "{#DotPaintAppPath}\Effects\MyApp"; DestName: "MyApp.exe"; Flags: ignoreversion replacesameversion restartreplace;
Source: "c:\myapp1.exe"; DestDir: "{app}"; DestName: "myapp1.exe"; Flags: ignoreversion replacesameversion restartreplace;
Source: "c:\myapp2.exe"; DestDir: "{app}"; DestName: "myapp2.exe"; Flags: ignoreversion replacesameversion restartreplace;
You should use {code:...} constant.
Take icons for
[Icons]
Name: "{code:GetMyPath}\MyApp"; Filename: "{app}\myApp.exe"; WorkingDir: "{app}"; IconFilename: "{app}\myapp.ico"; IconIndex: 0
[code]
function GetMyPath(Param: String): string;
begin
Result := CustomStartMenu;
end;

Inno Setup - titles my setup as "My Setup", how to change this?

Here is my code: As you see I have given the name of my application, but still I get the title "My Setup" when I run it
[Setup]
AppName=Diabetis
AppVersion=0.9
DefaultDirName={pf}\Diabetis
DefaultGroupName=Diabetis
UninstallDisplayIcon={app}\Diabetis.exe
Compression=lzma2
SolidCompression=yes
OutputDir="C:\Users\nwsco\source\repos\Diabetis_sqllite\"
[Dirs]
Name: {app}; Permissions: users-full //to allow manipulating database
[Files]
Source: "C:\Users\nwsco\source\repos\Diabetis_sqllite\Diabetis\bin\Debug\Diabetis.exe"; DestDir: "{app}"
Source: "C:\Users\nwsco\source\repos\Diabetis_sqllite\Diabetis\bin\Debug\Diabetis.db"; DestDir: "{app}"
Source: "C:\Users\nwsco\source\repos\Diabetis_sqllite\Diabetis\bin\Debug\DSettings.db"; DestDir: "{app}"
Source: "C:\Users\nwsco\source\repos\Diabetis_sqllite\Diabetis\bin\Debug\Diabetis.pdb";
[Icons]
Name: "{group}\Diabetis"; Filename: "{app}\Diabetis.exe"
I solved my problem by adding:
OutputBaseFilename=Diabetis_Setup.exe
but now I have another problem, the program will display Diabetis_Setup.exe.exe, writing therefore twice the .exe.
I have tried also:
OutputBaseFilename=Diabetis_Setup
but it does not like it

Copying hidden files in Inno Setup

How to use copy hidden external files in Inno Setup? Not to make a file hidden, but to work with hidden files. Because for now: the hidden files are being ignored
Any help? Thanks )
[Files]
Source: "{src}\folder\*"; DestDir: "{app}"; \
Flags: skipifsourcedoesntexist external ignoreversion recursesubdirs createallsubdirs;
When you select files in [Files] section entry using a wildcard, Inno Setup installer explicitly skips hidden files.
You cannot do anything about it.
See RecurseExternalCopyFiles function in Projects\Install.pas, particularly this part:
if SourceIsWildcard then begin
if FindData.dwFileAttributes and FILE_ATTRIBUTE_HIDDEN <> 0 then
Continue; { <-- Skip hidden files, comment by #MartinPrikryl }
FileName := FindData.cFileName;
end
else
FileName := SearchWildcard; { use the case specified in the script }
(This is for external files, as that's what you use. But for compile-time files, it's the same. See BuildFileList in Compile.pas).
All you can do, is to implement the installation in [Code] script yourself, instead of using the [Files] section.
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
Log('Installing files');
DirectoryCopy(ExpandConstant('{src}\folder'), ExpandConstant('{app}'));
end;
end;
For implementation of DirectoryCopy, see my answer to question Inno Setup: copy folder, subfolders and files recursively in Code section.
For compile-time files (without external flag), you can generate list of [Files] entries using a preprocessor function FindFirst.
the answer is You CAN
make windows display hidden files just for you to be able to see them
with your files hidden as you want them inside the folder.
when adding source folder and files step just add the folder (this wildcard *) normally, Inno setup won't add the hidden files. so add them separately.
after you finsih all steps don't run the script and edit the code..
go to [Files] section:
[Files]
Source: "H:\tmp\sweetInstaller\installer.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\tmp\sweetInstaller\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "H:\tmp\sweetInstaller\hidden_file1.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\tmp\sweetInstaller\hidden_file2.bat"; DestDir: "{app}"; Flags: ignoreversion
AND insert Attribs: hidden; next to files you wish to hide just before Flags:
[Files]
Source: "H:\tmp\sweetInstaller\installer.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\tmp\sweetInstaller\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "H:\tmp\sweetInstaller\hidden_file1.txt"; DestDir: "{app}"; Attribs: hidden; Flags: ignoreversion
Source: "H:\tmp\sweetInstaller\hidden_file2.bat"; DestDir: "{app}"; Attribs: hidden; Flags: ignoreversion
then you can run the script from the little green play button at the top bar to compile. and you're done ;)

inno-setup OR javafx packager changes my desktop icon, jagged edges

So I'm using Innosetup with javafxpackager, I specify a desktop icon (.ico) in the iss file with 'SetupIconFile'.
After installing the application (Win7) the icon on the desktop has jagged edges. At first I thought something was wrong with my icon, but if I right-click the icon and change the icon to the file I specified in the iss file, it has crispy clean edges.
So I'm guessing either Inno-Setup, or javafxpackager does something to my icon (tried with all manner of sizes and multi-layered ico files btw). And I'm guessing the chances are higher it has something to do with Inno-Setup, since I specify the icon in the iss.
Any ideas what could be wrong?
Edit: I said I specify the icon with 'SetupIconFile' but I didn't look correctly in my iss file, I actually do:
[Files]
Source: "MyApp\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "MyApp\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\MyApp"; Filename: "{app}\MyApp.exe"; IconFilename: "{app}\MyApp.ico"; Check: returnTrue()
Name: "{userdesktop}\MyApp"; Filename: "{app}\MyApp.exe"; IconFilename: "{app}\MyApp.ico"; Check: returnTrue()

Add a check box to not add the start menu icons

So this is probably really simple, and I've been looking and looking for an example, but can't seem to find one.
I just need to add a check box to select the option NOT to create a start menu shortcut to the screen where it says, "Select Start Menu Folder - Where should Setup place the program's shortcuts?". Just not sure how to do this. Help would be vastly appreciated.
Here's my code so far:
[Setup]
AppName=My Launcher
AppVersion=1.1
DefaultDirName={pf}\My Launcher
DefaultGroupName=My Launcher
UninstallDisplayIcon={app}\myLauncher.exe
Compression=lzma2
SolidCompression=yes
[InstallDelete]
Type: files; Name: "{app}\myLauncher.exe";
[Files]
Source: "myLauncher.exe"; DestDir: "{app}"
Source: "QtCore4.dll"; DestDir: "{app}"
Source: "QtGui4.dll"; DestDir: "{app}"
Source: "QtNetwork4.dll"; DestDir: "{app}"
Source: "QtSql4.dll"; DestDir: "{app}"
Source: "Readme.txt"; DestDir: "{app}"
[Icons]
Name: "{group}\My Launcher"; Filename: "{app}\myLauncher.exe"
Under the [Setup] section, try adding this to the end:
AllowNoIcons=yes
See here for the official documentation on this property.

Resources