Why doesn't the _issi.cfg file work in Inno Setup? - inno-setup

I wrote this code to add the splash screen before my installer starts:
[ISSI]
#define ISSI_Splash "C:\ABoffice\Install\InnoSetupProject\Images\client.bmp"
#define ISSI_Splash_T 5
#define ISSI_Splash_X 500
#define ISSI_Splash_Y 220
//#define ISSI_IncludePath "C:\ISSI"
#include ISSI_IncludePath+"\_issi.isi"
[Setup]
AppName=Client AB OFFICE
AppVersion=5.0
DefaultDirName={sd}\AB_Office\Client
The instruction manual says that I can configure my ISSI installation by setting some presets in the "_issi.cfg" file located in the ISSI folder.
Here's how my "_issi.cfg" file looks like:
[ISSI Configuration]
#define ISSI_IncludePath "C:\ISSI"
;#define ISSI_Constants "YYMDHMS"
;#define ISSI_ConstantsSeperator "."
;#define ISSI_Compression
;#define ISSI_BeveledLabel
[Setup]
OutputDir=C:\Inno Setup Output
But when I compile my script I get this error:
[ISPP] Undeclared identifier: "ISSI_IncludePath".
What do I need to add to my code to be able to read from the _issi.cfg?

You are setting ISSI_IncludePath in the _issi.cfg.
And you then try to include the _issi.cfg into your .iss script by referring to it using the ISSI_IncludePath.
That's a circular dependency.
Maybe you wanted to set the ISSI_IncludePath in your iss file:
#define ISSI_IncludePath "C:\ISSI"
#include ISSI_IncludePath+"\_issi.isi"
Then you will probably have you remove the #define ISSI_IncludePath from the _issi.cfg.

Related

Inno Setup constants and parameters [duplicate]

This question already has answers here:
Passing in version number to Inno Setup compiler
(3 answers)
Closed 2 years ago.
I'm trying to add a parameter to my setup file, with a default value.
In this case I get a compile error at
OutputBaseFilename=MyApp {param:Version|{#MyAppVersion}} Setup
Saying:
Value of [Setup] section directive "OutputBaseFilename" is invalid
Shortened reference code:
#define MyAppName "My App"
#define MyAppVersion "1.7.24"
[Setup]
AppName={#MyAppName}
AppVersion="{param:Version|{#MyAppVersion}}"
DefaultGroupName=VHStudio
OutputBaseFilename=MyApp {param:Version|{#MyAppVersion}} Setup
SetupIconFile={#PathToRepoRoot}\Development\VHS\VHSStudio\media\logo.ico
[Icons]
Name: "{group}\VHStudio {param:version|MyAppVersion}"; Filename: "{app}\VHStudioApp.EXE"; WorkingDir: "{app}"
Name: "{group}\Uninstall VHStudio"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\VHStudioApp.EXE"; Tasks: desktopicon
I'm guessing I'm using the constant wrong?
The Strange thing is that I do
AppVersion="{param:Version|{#MyAppVersion}}"
Without any errors...
Based on the comment from Martin. Suggesting to take a look at Passing in version number to Inno Setup compiler.
Turns out I overcomplicated things. You can easily pass parameters to the compiler for pre-processor variables. In my situation MyAppVersion.
What I did in Inno Setup:
#ifndef MyAppVersion
#define MyAppVersion "1.7.24"
#endif
And when compiling it looks like this:
ISCC.exe myProg.iss /DMyAppVersion=1.7.14

Error: conflicting types when trying to make a simple syscall

I'm brand new to Linux programming and I'm trying to implement a simple system call loosely following this guide: https://medium.com/anubhav-shrimal/adding-a-hello-world-system-call-to-linux-kernel-dad32875872. In my linux kernel directory, I created a new directory called my_syscall. Within that directory, I created my_syscall.c. Here is my_syscall.c
#include <linux/syscalls.h>
#include <linux/kernel.h>
asmlinkage long sys_my_syscall(int i) {
prink(KERN_INFO "This is the system call.");
return(0);
}
I then created a Makefile in the my_syscall directory with a single line:
obj-y := my_syscall.o
I then edited this line in the Makefile in the kernel directory to be:
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ my_syscall/
Then, in the directory linux-5.4.15/arch/x86/entry/syscalls, I edited the syscall_64.tbl to include the following line at the very end:
548 64 my_syscall sys_my_syscall
Finally, in the directory linux-5.4.15/include/linux, I edited the syscalls.h file to include this line before the #endif:
asmlinkage long sys_my_syscall(int i);
Now, when I run the command sudo make, I run into the following error soon after:
./arch/x86/include/generated/asm/syscalls_64.h:2664:19: error: conflicting types for 'sys_my_syscall'
__SYSCALL_64(548, sys_my_syscall, )
arch/x86/entry/syscall_64.c:18:60: note: in definition of macro '__SYSCALL-64'
#define __SYSCALL_64(nr, sym, qual) extern asmlinkage long sym(const struct pt_regs *);
In file included from arch/x86/entry/syscall_64.c:7:0:
./include/linux/syscalls.h:1423:17: note: previous declaration of 'sys_my_syscall' was here
asmlinkage long sys_my_syscall(int i);
^
make[3]: *** [arch/x86/entry/syscall_64.o] Error 1
make[2]: *** [arch/x86/entry] Error 2
make[1]: *** [arch/x86] Error 2
make: *** [sub-make] Error 2
I have no idea how to approach this error. With a conflicting types error, I would think I declared the syscall differently in someplace, but in both my_syscall.c and the syscalls.h files, the declaration is the same. These were the only two files where the syscall is declared, but it is also named within syscall_64.tbl and it seems like this is where linux is trying to point me towards. However, I don't see what's wrong with how I declared it in the table as I followed the guide directly. Any help with this would be greatly appreciated!
Info:
Kernel version: 5.4.15
Linux Distribution: Ubuntu 14
I just changed the location where the syscall number is defined in syscall_64.tbl.
Instead of this:
548 64 my_syscall sys_my_syscall
I wrote this:
436 common my_syscall __x64_sys_my_syscall
Screen Capture of my configuration
It worked out.
I'm doing something similar and got the exact same error.
What fixed the error for me is changing the last part of the syscall_64.tbl table entry from "sys_my_syscall" to "__x64_sys_my_syscall". If you scroll up, other entries have the same prefix. The kernel started compiling after I made that change.
I eventually gave up on trying to implement this in kernel 5. Unfortunately, none of the other solutions resulted in my kernel compiling. I rolled back my kernel and followed the steps here. This resulted in the system call working correctly. I'm not sure how to make this function in kernel 5+.
#include <linux/syscalls.h>
#include <linux/kernel.h>
SYSCALL_DEFINE1(my_syscall, int, i)
{
printk(KERN_INFO "This is the system call (param %d).\n", i);
return(0);
}
For kernel 5, try deleting "sys_" before "my_syscall" and try. It worked for me
Some architectures (including x86-64) use syscall wrappers to call the real syscall handler. To define the real syscall handler and its wrappers (for architectures that use syscall wrappers), use one of the SYSCALL_DEFINE<n> macros before the body of the syscall handler. The parameters of the SYSCALL_DEFINE<n> macros are the function name, followed by <n> pairs of ``type, param'' for the function parameters.
Your sys_my_syscall syscall handler function has one parameter, so use the SYSCALL_DEFINE1 macro before the body of the function:
#include <linux/syscalls.h>
#include <linux/kernel.h>
SYSCALL_DEFINE1(sys_my_syscall, int, i)
{
printk(KERN_INFO "This is the system call (param %d).\n", i);
return(0);
}

How do I automatically set the version of my Inno Setup installer according to my application version?

I am using Inno Setup to generate the installer of my application. How can set the version number of the setup.exe (VersionInfoVersion) generated by Inno to match with the version number of my application automatically? Now every time I deploy a new version of my application I need to update the version number manually.
Now I'm doing this:
[Setup]
VersionInfoVersion=1.2.2.0 //writing the value manually
I want something like this:
[Setup]
VersionInfoVersion={Get the version of my app}
You can use the Inno Setup Preprocessor GetVersionNumbersString function like this
#define ApplicationName 'Application Name'
#define ApplicationVersion GetVersionNumbersString('Application.exe')
[Setup]
AppName={#ApplicationName}
AppVerName={#ApplicationName} {#ApplicationVersion}
VersionInfoVersion={#ApplicationVersion}
Another way to do it by using a command line argument :
[Setup]
AppVersion={#MyAppVersion}
and you just call your script as follow from a cmd :
cd C:\Program Files (x86)\Inno Setup 5
iscc /dMyAppVersion="10.0.0.1" "C:\MyPath\MyScript.iss"
It emulate #define MyAppVersion="10.0.0.1" in the iss script.
If you are using CakeBuild, you can pass this argument as
string CurrentVersion = "10.0.0.1";
InnoSetupSettings settings = new InnoSetupSettings();
settings.Defines= new Dictionary<string, string>
{
{ "MyAppVersion", CurrentVersion },
};
InnoSetup("C:\MyPath\MyScript.iss", settings);
In case you have a pure webinstaller, the accepted solution won't work,
because you simply won't have an application.exe to get the version number from.
I'm using Nant and a build.xml file with version number properties, which i manually bump, before i'm rebuilding the innosetup installers.
My *.iss files contain a special token #APPVERSION#, which is replaced
with the version number during the build process. This is done via a copy operation with an applied filterchain, see below.
InnoSetup Script (*.iss)
// the -APPVERSION- token is replaced during the nant build process
#define AppVersion "#APPVERSION#"
nant build.xml:
<!-- Version -->
<property name="product.Name" value="My Software"/>
<property name="version.Major" value="1"/>
<property name="version.Minor" value="2"/>
<property name="version.BuildNumber" value="3"/>
<property name="product.Version"
value="${version.Major}.${version.Minor}.${version.BuildNumber}"/>
<!-- build task -->
<target name="bump-version"
description="Inserts the current version number into the InnoScript.">
<copy todir="${dir.Build}" overwrite="true">
<fileset basedir="${dir.Base}/innosetup/">
<include name="product-webinstaller-w32.iss"/>
<include name="product-webinstaller-w64.iss"/>
</fileset>
<filterchain>
<replacetokens>
<token key="APPVERSION" value="${product.Version}"/>
</replacetokens>
</filterchain>
</copy>
</target>
I had some problems with getting this to work, so just contributing my solution.
app.iss:
[Setup]
#include "Config.txt"
#define AppVersion GetFileVersion("Input\" + AppExec)
AppName={#AppName}
AppVersion={#AppVersion}
Config.txt:
#define AppName "App"
#define AppExec "App.exe"
As others have mentioned, the GetFileVersion or GetStringFileInfo preprocessor functions can be used for that.
Some important info, improvements and helpful additions:
You can either use an absolute path to the exe, or a path relative to the .iss file
You can include existing defines in your statement by just writing their name, and concatenate defines with the + operator:
#define MyAppPath "..\Win32\Release\" + MyAppExeName
If you want you can easily remove parts of the version number from the right by using the function RemoveFileExt, e. g. convert 3.1.2.0 to 3.1.2:
#define MyAppVersion RemoveFileExt(GetFileVersion(MyAppPath))
You can use the defines MyAppExeName and MyAppPath in the subsequent options like Messages, Files or Icons
Working example:
#define MyAppName "Application Name"
#define MyAppExeName "Application.exe"
#define MyAppPath "..\Win32\Release\" + MyAppExeName
#define MyAppVersion RemoveFileExt(GetFileVersion(MyAppPath))
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
OutputBaseFilename={#MyAppName}-{#MyAppVersion}-Windows
...
[Messages]
SetupWindowTitle=Setup - {#MyAppName} {#MyAppVersion}
...
[Files]
Source: {#MyAppPath}; DestDir: "{app}"; Flags: ignoreversion; Tasks: desktopicon
...
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
In my case, I would like to define the version string from a file. I don't have an EXE, since my installer is packing an embedded Python program. So I define the version number in a one-line text file like such (this is created from a git tag statement beforehand):
..\Build\app_version.txt:
v1.2.1
In the Inno Setup, I used a pre-processor define statement to set the version throughout the text.
#define VerFileNum FileOpen("..\Build\app_version.txt")
#define MyAppVersion Trim(StringChange(FileRead(VerFileNum),"v",""))
Here, I used Trim() and StringChange() to remove the leading "v" and trailing spaces from the string. Later in the setup section, the AppVersion value can be set using the pre-processor definition:
[Setup]
AppVersion={#MyAppVersion}
The Inno Setup pre-processor has quite an extensive set of functions already defined: Inno setup pre-processor functions
After quite some time trying other methods, the way it worked for me was to use a relative path (I have the .iss file in a folder and the EXE file two levels above).
; Extract File Version from EXE
#define MyAppVersion GetFileVersion("..\..\Release\CSClave.exe")

include file error?

I have these lines inside my code. I have also included the file in my header list inside my project. But when compile I got the below error. What is my mistake?
#ifndef WIN32
# include <netinet/in.h>
# include <arpa/inet.h>
# include <unistd.h>
# include <netdb.h>
# include <sys/socket.h>
# include <sys/un.h>
# include <pwd.h>
# include <grp.h>
#else
# include "getopt.h"
# include <stdarg.h>
# pragma comment (lib, "wpcap.lib")
#endif /* ^WIN32 */
Error 1 fatal error C1083: Cannot open include file: 'getopt.h': No such file or directory c:\filetry.c
getopt is not a visual c header. This might help: http://www.codeguru.com/forum/archive/index.php/t-393293.html

Unresolved external symbol

I have two WIN32 DLL projects in the solution, main.dll should call a function in mgn.dll.
mgn.dll has mgn.h header file:
#ifdef MGN_EXPORTS
#define MGN_API __declspec(dllexport)
#else
#define MGN_API __declspec(dllimport)
#endif
extern "C" bool MGN_API AttachMGN(void);
and mgn.cpp source file:
#include "stdafx.h"
#include "mgn.h"
MGN_API bool AttachMGN(void)
{
...
}
main.dll calls AttachMGN function from one of the source file:
#include "stdafx.h"
#include "..\mgn\mgn.h"
bool CreateClient()
{
return ::AttachMGN();
}
mgn.dll compiles successfully. main.dll doesn't show any errors in VS text editor, I can navigate using "Go To Definition" function. However during build I get the error:
error LNK2019: unresolved external symbol __imp__AttachMGN referenced in function "bool __cdecl CreateClient(void)" (?CreateClient##AW4XZ)
Both DLLs compile into the same folder. DependencyWalker shows the function AttachMGN as exported. Main project has a dependency set to Mgn project, if that matters.
I believe that I simply have overlooked something....
Thanks in advance.
You probably just forgot to add MGN.lib to your link arguments for main.dll
Is your mgn.lib linked with the main? By the sound of it, it looks as if main cannot find the lib file to link against the DLL.

Resources