Inno-Setup: Post Install open link: antivirus alert while opening a link - installation

I am building an installer with inno setup that opens a link to a website after installation
Currently this looks like this:
[Run]
Filename: iexplore.exe; Parameters: http://doma.in/uri/ Verb: open; Flags: shellexec runasoriginaluser
This works fine, except that testing revealed that for example Kaskersky raises a warning that an unauthorized process (the setup) started an authorized process (internet explorer) that wants to access the encrypted passwords. Which could (of course) be a threat.
As I just want to open a browser to display the url it would be great to get rid of this message.
This are the options I evaluated so far
Unfortnuately there is no difference between Run Filename: iexplore and the Pascal Script Shell-Exec('open' ...)?
Perhaps it is somehow possible to pass the operating system a message to create a new instance of the webbrowser without creating it as a child process (i.e. without triggering the warning) of the setup.
As I am doing this for statistics it would be sufficient to call the winhttp library from within the setup. but this is not feasible, because the user could have a firewall installed (see HTTP POST request in Inno Setup Script).
Does it help to sign the setup? Would this suppress the warning?

in the end of your iss file:
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrCode: integer;
begin
if (CurStep=ssDone) then
begin
ShellExec('open', 'http://your.app.url/', '', '', SW_SHOW, ewNoWait, ErrCode);
end;
end;

The following works for me:
[Run]
Filename: "http://doma.in/uri/"; Flags: shellexec runasoriginaluser

What Mike Sutton pointed out was essentially right, but you need to add postinstall to the flags. That sets it to run after the setup has finished. In addition, you need Description to tell the setup finished screen what to display for the checkbox.
[Run]
Filename: "http://doma.in/uri/"; Flags: shellexec runasoriginaluser postinstall; Description: "Open the url."
You might also consider the unchecked flag if you want the option to be opt in instead of opt out.

Related

Inno Setup can't download big files from Google Drive [duplicate]

This question already has answers here:
Disabling the large file notification from google drive
(10 answers)
Closed 12 months ago.
Here is my Inno Setup code. The "Scripts.rar" file that i wanna download is about 1 GB. If i put a file that's 25MB, it's working. With this file instead, it just proceeds installing the offline files, skipping the download of the big "Scripts.rar".
I need to download really big files with this setup. They are about 20 files, each one with a 1-3GB size.
InnoSetup is putting me a huge limitation.
#pragma include __INCLUDE__ + ";" + ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir")
#pragma include __INCLUDE__ + ";" + "c:\lib\InnoDownloadPlugin"
#include <idp.iss>
[Code]
idpAddFile('https://drive.google.com/uc?export=download&confirm=hoYh&id=1UnIIBtjhDqtNuSKyeF5ce0grVlTnIIyz', ExpandConstant('{tmp}\Scripts.rar'));
//Download after "Ready" wizard page
idpDownloadAfter(wpReady);
end;
[files]
Source: "C:\Users\Dedric\Desktop\New folder (3)\GTA Compton Compiler\UnRAR.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Run]
Filename: "{tmp}\UnRAR.exe"; Parameters: "x ""{tmp}\Scripts.rar"" ""{code:GetDirPath}"""
Filename: "{code:GetDirPath}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
When you try to manually download your file the browser looks like this:
It states:
Google Drive can't scan this file for viruses.
Scripts.rar (311M) is too large for Google to scan for viruses. Would you still like to download this file?
This is the reason it won't download. It requires user interaction to agree to download the file without performing a virus scan.
If there is any way to get around that, well it would be a Google Drive matter. But it is probably against their policies to ignore displaying the warning. This is not a Inno Setup issue.
Update
A quick search on the internet revealed this article where it says:
Right-click Download anyway and click Inspect Element.
It also says:
Add the "https://drive.google.com" before "/uc?"
So your link becomes:
https://drive.google.com/uc?export=download&confirm=z8LQ&id=1UnIIBtjhDqtNuSKyeF5ce0grVlTnIIyz
Use that link in your script.

Quick Lanch bar and Inno Setup v6

My installer started off years ago and thus has a Quick Launch bar task.
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Public Talks"; \
Filename: "{app}\CommunityTalks.exe"; \
MinVersion: 4,4; \
Tasks: quicklaunchicon
When compiling this raises the warning:
Warning: The [Setup] section directive "PrivilegesRequired" is set to
"admin" but per-user areas (HKCU,userappdata) 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.
How should we handle that?
Remove the "Quick Launch" toolbar functionality from your installer.
No one is using that nowadays. The "Quick Launch" toolbar was removed in Windows 7 (2009).

What is wrong with my run code using Inno-setup?

I have written code with Inno-Setup to install a 2007 desktop MSAccess split data base and am including Access Runtime 2007. I have tried several variations of "running" the "AccessRuntime.exe" with the database but still get errors. Here are some of the constants and sections:
MyAppName "SSDExpress"
DefaultDirName=C:\{#MyAppName}
OutputDir= C:\{#MyAppName}
MyAppExeName "setup.exe"
[Files]
Source: C:pathtofiles\SSDExpress.accde; DestDir: "{app}"; Flags: ignoreversion
Source: C:pathtofiles\SSDExpress_be.accdb; DestDir: "{app}"; Flags: ignoreversion
Source: C:pathtofiles\AccessRuntime.exe; DestDir: "{app}"; Flags: ignoreversion
I have tried each of these 3 Run codes separately without success. Eachtime I have received errors related to the runtime.
1st try
[Run]
Filename:{app}\AccessRuntime.exe; Description:{cm:LaunchProgram,{#MyAppName}};Flags:
shellexec postinstall skipifsilent; Parameters: “””{app}\{#MyAppExeName}””/runtime”
2nd try
[Run]
Filename: Filename:{app}\{#MyAppExeName;Parameters: “/i””{app}\AccessRuntime.exe””/qn”
3rd try
[Run]
Filename: AccessRuntime.exe; Parameters: “/i””{app}\AccessRuntime.exe””/passive”
What am I doing wrong? (The code works to get all the files into the DefaultDirectory, but still I get messages that it cannot find the "AccessRuntime.exe" for the run code.)
Excuse my confusion in stating my problem. It may help to know that I have never written an installation script before. My only experience is using MS Access Packaging Wizard and I guess I assumed Inno was going to setup similarly.
To clarify what I want to do: I am trying to get a script to create a setup for users, which I can send to them and they can run to install a desktop MS Access 2007 database (SSDExpress), which will require Access Runtime to run if they don't already have access. Ideally I would like to include Access Runtime in the install package for them vs a download. So I want the Setup to install the program, which when they then access it, it will run as a stand alone desk top program. I want the FE to be separate (vs. PW accdr file) so that I can update program changes as needed.
I thank you in advance for your patience. Tricia
The "1st try" is correct, and the others incorrect. (Or at least the syntax is correct; you will have to discover for yourself what the correct parameters to pass to the runtime are.)
However two things to note:
This may have just been a side effect of posting it here, but your code includes "smart" quotes instead of standard quotes. You will have to change these to standard quotes for it to work.
You do not have a space between the filename and the /runtime parameter in the Parameters value.
The very first thing that you need to do is to try running it yourself from the command line with the parameters you think you need, and make sure that this works. Once you know that it works from the command line, it's just a simple matter of using the right syntax to get Inno to run it during the install.

Inno Setup drivers install

I cannot find a way for Inno Setup to install drivers.
I have checked these questions here:
Inno setup: install drivers with rundll32 or dpinst?
How to run a file before setup with Inno Setup and How to install DirectX redistributable from Inno-setup?.
My code is like this:
[Files]
Source: "drivers\dpinst64.exe"; DestDir: "{app}\drivers"; Check: Is64BitInstallMode; Components: drivers;
[code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
ResultCode: Integer;
begin
if IsWin64 then begin
ExtractTemporaryFile('drivers\dpinst64.exe');
Exec(ExpandConstant('{tmp}\dpinst64.exe'), '-install "' + ExpandConstant('{tmp}') + '"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
end;
1) Right now my installer crashes because it cannot find drivers\dpinst64.exe when extracting the temporary file.
2) Before this i tried simply running the .exe in [run] but nothing happened. When the .exe was run, the run lasted 5 miliseconds and then I got the -2147483648 return code. Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) runs just fine in InitializeSetup.
What could be the problem here? Is there another better way to initiate driver instalation right before the installer finishes its work?
If you try this, what will happen?
What is the parameter to install dpinst64.exe? From your attempt, it looks like this (assuming that {tmp} ends up being Windows %TEMP%):
%TEMP%\dpinst64.exe -install "%TEMP%"
Is it the correct statement to install dpinst64.exe?
[Files]
Source: "drivers\dpinst64.exe"; DestDir: "{tmp}"; Check: Is64BitInstallMode; Components: drivers;
[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
ResultCode: Integer;
begin
if IsWin64 then begin
ExtractTemporaryFile('dpinst64.exe');
Exec(ExpandConstant('{tmp}\dpinst64.exe'), '-install "' + ExpandConstant('{tmp}') + '"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
end;
I assume that the driver dpinst64.exe is the only file in the drivers folder of your source that needs to be distributed in your installer. If it is not the case, then you should type as follows:
[Files]
Source: "drivers\*"; DestDir: "{tmp}"; Check: Is64BitInstallMode; Components: drivers;
To answer your questions:
1. You should use ExtractTemporaryFile('dpinst64.exe'); instead of ExtractTemporaryFile('drivers\dpinst64.exe');.
2. For the failure to run the DPINST64.EXE, you might need to extract the INF, SYS, and any other dependencies for the driver into the directory where DPINST64.EXE. You would need multiple ExtractTemporaryFile statements to extract multiple files.
keep in mind that dpinst is software first meaning it doesn't actually install the device until it is plugged in.

Why do I get a 1720 error when my InstallShield setup tries to run my VBS custom action?

The Custom Action is configured as follows:
Custom Action Name: MyCustomAction
VBScript Filename: <PathVar01>\MyFolder\MyVBSfile.vbs
ScriptFunction: MyFunction
Return Processing: Synchronous (Check exit code)
In-Script Execution: Immediate Execution
It is being executed via the following InstallScript code:
result = MsiDoAction(ISMSI_HANDLE,"MyCustomAction");
When the setup reaches that line in InstallScript, the installer shows an error alert, stating:
"Error 1720.There is a problem with
this Windows Installer package. A
script required for this install to
complete could not be run. Contact
your support personnel or package
vendor."
The result code returned by MsiDoAction is that of '1603', which, according to winerror.h, is:
//
// MessageId: ERROR_INSTALL_FAILURE
//
// MessageText:
//
// Fatal error during installation.
//
#define ERROR_INSTALL_FAILURE 1603L
Why is this happening? I was starting to doubt that the file was included properly. Yet, I am pointing to the correct file, and I've tried including the VBS via the InstallShield Support Files, thinking this would ensure the file was present with the setup, but same result.
Running the setup with logging enabled revealed the problem:
Action 13:29:19: MyCustomAction.
Action start 13:29:19: MyCustomAction.
Error 1720.There is a problem with
this Windows Installer package. A
script required for this install to
complete could not be run. Contact
your support personnel or package
vendor. Custom action MyCustomAction
script error -2146827278, Microsoft
VBScript compilation error: Expected
identifier Line 163, Column 37,
blnExample,)
To run a setup with logging enabled:
"C:\SetupFolder\setup.exe" /V"/l*v
c:\Install.log"
This forum thread was helpful.

Resources