Can Inno Setup compiler halt upon Exec() preprocessor function failure? - inno-setup

My Inno Setup script runs a batch script while compiling using #expr, like so:
#expr Exec("\build.bat", null, null, 1)
By design, #expr ignores the return value of the Exec() call. This silently discards any errors, which is not desirable in my case.
Can Inno Setup be made to halt compiling upon Exec() failure?

Use #if and #error directives:
#if Exec("\build.bat", null, null, 1) != 0
#error The build batch has failed
#endif

Related

How do I make Yargs exit if it is passed an invalid flag?

I am using the Yargs JavaScript library for parsing command-line arguments.
The following is a Hello-World-style Yargs program. By default, it includes "--help" and "--version", and I am adding a 3rd option, "--copy":
const argv = yargs(process.argv.slice(2))
.alias("h", "help") // By default, only "--help" is enabled
.alias("v", "version") // By default, only "--version" is enabled
.boolean("copy")
.alias("c", "copy")
.describe("c", "run the copy function")
.argv;
However, running the program with a bogus flag (e.g. "--foo") will still work. I want the program to throw an error and exit if an invalid flag is passed. How do I do this?
Apparently this is performed using the strict mode:
https://github.com/yargs/yargs/issues/1890

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);
}

Inno Setup directive "VersionInfoVersion" is invalid

In my *.iss installer script I'm passing application version to the VersionInfoVersion param
VersionInfoVersion = {#ver}
where {#ver} is 0.4.0.201801182
According to Inno Setup documentation format is correct. However, I'm getting the following error:
Value of [Setup] section directive "VersionInfoVersion" is invalid.
Compile aborted.
The problem is the last section of your version. It appears that each section only supports up to 65,535. For example:
#define ver "0.4.0.65535" ;this works
#define ver "0.4.0.65536" ;this fails

Windows App Certification Kit hangs

I have developed windows 10 App and uploaded that to windows store. However, I wanted to apply Windows Certification App Kit. The testing hangs during these two stages;
Direct3D trim after suspend
In progress...
UTF-8 file encoding
In progress...
I don't use any of those features in my app, but I don't understand why it should hang during process?
Thank you!
I ran into this exact same issue:
"Direct3D trim after suspend In progress... UTF-8 file encoding In progress..."
Problem was that I didn't try to run the Release Version locally first. It didn't run because I used preprocessor directives like so:
public static LicenseInformation licenseInformation = null;
...
#if DEBUG
...
...
licenseInformation = CurrentAppSimulator.LicenseInformation;
#else
licenseInformation = CurrentApp.LicenseInformation;
#endif
"CurrentApp" did cause an exception.. I use code like this now:
#if DEBUG
...
...
licenseInformation = CurrentAppSimulator.LicenseInformation;
#else
try
{
licenseInformation = CurrentApp.LicenseInformation;
}
catch (Exception)
{
}
#endif
And when working with the licenseInformation somewhere I check if it is not null before I use it...
I also found some other issues (warnings) in my code by using "Run Code Analysis on Solution"..
So in my case it was a problem with my code.
WACK "Hangs" because it is waiting for the app to start.The problem occurs if you use packages that internally use native code. An example is SQLite (Written in C++).
SQLite for Universal Windows Platform requires this Directive to be included in Properties/Default.rd.xml. Otherwise the external code will throw exceptions when your app is run in native mode (Release build in Visual Studio).
<Type Name="System.Collections.ArrayList" Dynamic="Required All" />
For details about this directive and EntityFramework.Sqlite (EF7), see: https://docs.efproject.net/en/latest/platforms/uwp/getting-started.html

Error on building android-ndk-assets

I want load resources from c++ code. And try repeat this way. But when i try build it, i get:
E:\Android\Samples\android-ndk-assets\project>e:\Android\android-ndk-r8b\ndk-build
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
"Compile thumb : png <= pngrtran.c
jni/libpng/pngrtran.c: In function 'png_do_expand':
jni/libpng/pngrtran.c:3790:1: internal compiler error: in reload, at reload1.c:1061
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [obj/local/armeabi/objs-debug/png/pngrtran.o] Error 1
I just ran into this problem as well. Another workaround is to build the library as ARM code instead of Thumb code by adding the following line to your makefile:
LOCAL_ARM_MODE := arm
There should be no problem using ARM mode... ARM instructions require twice the space of Thumb instructions but are also much more sophisticated and capable of accomplishing a lot more in a single instruction, so depending on the cleverness of the compiler the resultant code may be bigger or smaller as well as more efficient or less efficient, but should execute with the same results.
I had the same error in android-ndk-r8b.
Looks like the bug in GCC. Do you submit bug report already?
I found the code which make error:
if (*(sp - 5) == red_high &&
*(sp - 4) == red_low &&
*(sp - 3) == green_high && //this line make error
*(sp - 2) == green_low && //this line make error
*(sp - 1) == blue_high &&
*(sp ) == blue_low)
{
*dp-- = 0;
*dp-- = 0;
}
I have a similar error in android-ndk-r8b as well. It occurs when calling ndk-build with the NDK_DEBUG flag set:
ndk-build NDK_DEBUG=1 <--- error
Try setting the NDK_BUILD flag to 0. It should compile. Of course it won't be debuggable :(
ndk-build NDK_DEBUG=0 <--- no error

Resources