Avoiding same installed programs which repeated in two times installed programs [duplicate] - inno-setup

This question already has answers here:
Use Inno Setup UI as a self-extractor only - No installation
(2 answers)
Closed 2 years ago.
I made the installer from LabVIEW for my application. Using this LabVIEW installer, I made another exe file that contains all files from LabVIEW installer with the help of Inno setup compiler. Reason for this, I need a single file installer to attach the digital signature. So, I used the Inno setup compiler and I got the single exe file.
But the problem I faced here, when I am installing this exe file(generated from Inno compiler), I can see the two installer files in the program list window.
one is from LabVIEW installer and another one is Inno Setup installer.
How can I avoid Inno setup installer?
Inno setup code:
#define MyAppName "My Product Name"
#define MyAppVersion "4.0"
#define MyAppPublisher "Company Name"
#define MyAppURL "https:/<Mydomain.com>/"
#define MyAppExeName "setup.exe"
[Setup]
SignTool=DigiSign $f
AppId={{02A34D16-B816-44B4-AFD6-C620DE6C3D85}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=<output directory>\SetupFiles
OutputBaseFilename=My app name_4.0.2006162255
Compression=lzma
SolidCompression=yes
WizardStyle=modern
RestartIfNeededByRun=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "<source file path where LabVIEW installer available>\*"; DestDir: "{userappdata}\<Path for extraction>"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
[Run]
Filename: "{userappdata}\..path .. where.. I .. want to install it...\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}";

Uninstallable=no
I supposed to use this command in the Inno setup. This resolved my issue.
For more information visit this link

Related

How to find installed directory in inno setup?

I have created an installer using innosetup. Where User can choose the directory where he wants to install by setting up DisableDirPage=No but when it comes to patch installers it is failed to update as user has been installed the app to his preferred directory. How to make installer to identify in which directory the app has been installed and make the patch installer to work.
installer code:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
Compression=lzma2
SolidCompression=yes
OutputDir = c:\test
OutputBaseFilename=update
DisableDirPage=No
[Files]
Source: "MyProg.exe"; DestDir: "{app}"
Source: "MyProg.chm"; DestDir: "{app}"
Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
If I unterstand you correctly you are talking about the setuo for your own application. You can put the UsePreviousAppDir directive in your [Setup] section. It's not necessary because its default value is 'yes' anyway. The documentation (http://jrsoftware.org/ishelp/) says that the Setup is looking for the same application, which is defined by the AppId or the AppName.
As long as you use AppName=My Program like in your example code, Inno Setup should find the install path of the old version itself. But if the AppName or AppId changes in your new version, there is no way to find it in the registry. A changing AppId is likely if you use a new guid for every setup.

Conditionally include folders in Inno Setup

I'm trying to create an installer with Inno Setup that will statically include a folder if it exists. This folder will be installed on the user system if a specific directory already exists on the user's system.
For example, there are configurations specific to 2017, 2018, 2019. If I have a CC2017 folder, then include it in the installer. The installer will put the folder on the user's system in their 2017 folder if it exists.
I use variables to define some of the path and have formatted them without brackets based on the answer here.
#ifexist projpath + "\" + reponame + "\Plug-Ins\Windows\CC2017\"
Source: "{#projpath}\{#reponame}\Plug-Ins\Windows\CC2017\{#pluginname}\*"; \
DestDir: "{sd}\Program Files\Adobe\Adobe InDesign CC 2017\Plug-Ins\{#pluginname}"; \
Flags: ignoreversion recursesubdirs createallsubdirs replacesameversion; \
Check: MyDirCheck(ExpandConstant('{sd}\Program Files\Adobe\Adobe InDesign CC 2017'))
#endif
I know it isn't checking correctly because the file size is much smaller when I add the ifexist directives. The Inno Setup docs mention "files" but not folders so I'm suspicious that it might not support checking folders.
What is wrong with the syntax?
I'm using Inno Setup 6.0.2 on Mac 10.13.6
There are two options:
Use skipifsourcedoesntexist flag:
[Files]
Source: "folder\*"; DestDir: "{app}"; Flags: skipifsourcedoesntexist
Use #if preprocessor directive along with DirExists preprocessor function:
[Files]
#if DirExists("folder")
Source: "folder\*"; DestDir: "{app}"
#endif

Run inno setup from shared drive

I have created a inno setup installer for my application. Now I want to place that installer on a shared folder where the users can install from there.
The installer need to place the files on the {%HOMEPATH}\{#MyAppName}directory. But when I set the AllowUNCPath=yes it can be ran from the shared drive but it will install the files on the fileshare\{%HOMEPATH}\{#MyAppName}.
Is it possible to run the installer from the fileshare and install it on the user local drive?
My setup section looks like:
[Setup]
AppId="{{AAAAAA-AAAA-AAAA-AAAA-AAAAAAAA}"
AppName={#MyAppName}
;AppVersion={#MyAppVersion}
AppVersion={code:getVersionNumber}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={%HOMEPATH}\{#MyAppName}
DefaultGroupName={#MyAppPublisher}
OutputDir=compiledInstaller
OutputBaseFilename=setup
SetupIconFile={#iconName}
;Set some installer settings
Compression=lzma
SolidCompression=yes
ArchitecturesAllowed=x64
PrivilegesRequired=lowest
AllowCancelDuringInstall=False
AllowUNCPath=false
ArchitecturesInstallIn64BitMode=x64
CreateUninstallRegKey=yes
UsePreviousAppDir=yes
;Disable different screens
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=True
DisableReadyMemo=True
DisableFinishedPage=True
DisableWelcomePage=True
[Files]
Source: "{#path}*"; DestDir: "{app}"; Flags: external recursesubdirs
Source: "{#path}/.eclipseproduct"; DestDir: "{app}"; Flags: external
Source: "{#installerPath}/{#ScriptName}"; DestDir: "{app}"; Flags: external
Source: "{#installerPath}/{#iconName}"; DestDir: "{app}"; Flags: external
The path and installerPath variables are linked to the files on the shared drive.
The error that I got when running the installer from the shared drive looks like:
Your problem has nothing to do with a shared drive.
It's due to the HOMEPATH variable. Its value is like \Users\username. There's no drive in the path. So it can only ever work, if you run the installer from the C: drive. If you run it from anywhere else, the path is naturally resolved incorrectly.
You have to use an absolute path. You can use USERPROFILE variable instead of HOMEPATH. The USERPROFILE value is like C:\Users\username.

How to disable message box of existing Folder in inno setup

I am using inno setup
I have tried the simple inno script code to install my program.exe, but the problem is that the setup always checks for the existing of the {app} (Distination Folder), and my goal is to hide the message box that says "Folder is exist, would you like to install to that folder anyway?"
my script is:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DisableProgramGroupPage=yes
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=userdocs:Inno Setup Examples Output
[Files]
Source: "MyProg.exe"; DestDir: "{app}"
Source: "MyProg.chm"; DestDir: "{app}"
Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
please see the picture bellow:
I found that:
DirExistsWarning=no
is working well, is there any other alternative ?

Inno Setup - How to execute MSI between 32 and 64 architectures

im trying to run 2 msi files for 32 and 64 bits from a third party and i am having a little trouble with the msi for 32bits windows architectures.
It seems the program extracts quite well the file but it doesn´t execute the installer. In the other hand for 64bits windows architectures the installer works. I don´t know where is the problem. Is there anything wrong with my code that im not seeing?Thank you!
[Setup]
...
ArchitecturesInstallIn64BitMode=x64
[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "filex64.msi"; DestName: "file.msi"; DestDir: "{app}"; Flags: deleteafterinstall; Check: Is64BitInstallMode
Source: "filex32.msi"; DestName: "file.msi"; DestDir: "{app}"; Flags: deleteafterinstall; Check: not Is64BitInstallMode;
Source: "manual.pdf"; DestDir: "{userdesktop}"; DestName: "Manual.pdf"
[Run]
Filename: "{sys}\msiexec.exe"; Parameters: "/package ""{app}\file.msi"" /qn /norestart /passive"; Flags: shellexec waituntilterminated; StatusMsg: "A instalar software {#MyAppVersion}";
Filename: "{userdesktop}\Manual.pdf"; Flags: postinstall;
I figure it out.
Flags
32bit
Causes the {sys} constant to map to the 32-bit System directory when used in the Filename and WorkingDir parameters. This is the default behavior in a 32-bit mode install.
This flag cannot be combined with the shellexec flag.
64bit
Causes the {sys} constant to map to the 64-bit System directory when used in the Filename and WorkingDir parameters. This is the default behavior in a 64-bit mode install.
This flag can only be used when Setup is running on 64-bit Windows, otherwise an error will occur. On an installation supporting both 32- and 64-bit architectures, it is possible to avoid the error by adding a Check: IsWin64 parameter, which will cause the entry to be silently skipped when running on 32-bit Windows.
This flag cannot be combined with the shellexec flag.
Source:
http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_iswin64
Based on this, i changed my script ir order to pinpoint correctly the "msiexec.exe" file for both architectures. Thank you guys!
[Run]
Filename: "{sys}\msiexec.exe"; Parameters: "/package ""{userdesktop}\Classic_Client_{#MyAppVersion}_64.msi"" /qn /norestart /passive"; Flags: 64bit skipifdoesntexist waituntilterminated; Check:IsWin64; StatusMsg: "A instalar Classic Client {#MyAppVersion} - 64bit";
Filename: "{sys}\msiexec.exe"; Parameters: "/package ""{userdesktop}\Classic_Client_{#MyAppVersion}_32.msi"" /qn /norestart /passive"; Flags: 32bit skipifdoesntexist waituntilterminated; StatusMsg: "A instalar Classic Client {#MyAppVersion} - 32bit";
the {sys} constant is the issue.
{sys} The system's System32 directory. For example: If you used
{sys}\CTL3D32.DLL on an entry and the system's Windows System
directory is "C:\WINDOWS\SYSTEM", Setup or Uninstall will translate it
to "C:\WINDOWS\SYSTEM\CTL3D32.DLL".
On 64-bit Windows, by default, the System32 path returned by this
constant maps to the directory containing 32-bit system files, just
like on 32-bit Windows. (This can be overridden by enabling 64-bit
mode.)

Resources