Inno Setup Uninstall - uninstallation

This is my situation, something like this:
I have three files: file1.txt, file2.txt, and file3.exe
I want to put three of them into a Directory in C:\Program Files, run file3.exe and create an uninstaller to uninstall everything with double-click on it.
when I make a double-click on uninstaller, the file3.exe will be uninstalled and all files will be removed from that Directory.
I've just done the first step, how can I do to get second step?
Thanks in advanced!

This is a good solution here
or I used this one: create an exe that can create a batch file which will uninstall the app and delete itself

you can use following code snippet of inno setup ,
[Files]
Source: "file3.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "file1.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "file2.txt"; DestDir: "{app}"; Flags: ignoreversion
[Run]
Filename: "{app}\file3.exe"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

Related

Solved - Build error -> ##[error]Solution not found using search pattern 'D:\a\1\s\**\*.sln'

YAMAL config file:
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://learn.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller#1
- task: NuGetCommand#2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild#1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest#2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
Error:
##[error]Solution not found using search pattern 'D:\a\1\s***.sln'.
RAW log:
2020-06-26T13:39:42.7115236Z ##[section]Starting: VSBuild
2020-06-26T13:39:42.7374773Z ==============================================================================
2020-06-26T13:39:42.7375115Z Task : Visual Studio build
2020-06-26T13:39:42.7375427Z Description : Build with MSBuild and set the Visual Studio version property
2020-06-26T13:39:42.7375688Z Version : 1.166.2
2020-06-26T13:39:42.7375904Z Author : Microsoft Corporation
2020-06-26T13:39:42.7376240Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
2020-06-26T13:39:42.7376608Z ==============================================================================
2020-06-26T13:39:46.1317137Z ##[error]Solution not found using search pattern 'D:\a\1\s***.sln'.
2020-06-26T13:39:46.1880482Z ##[section]Finishing: VSBuild
Agree with Daniel, the error message Solution not found using search pattern 'D:\a\1\s***.sln' clearly states that the cause of this error is that the .sln file is not found in the s folder.
You need to check whether your .sln file is pushed to the version control. You can search this in source repo of azure devops.
I had the same error in my yaml pipelines,
##[error]Solution not found using search pattern 'D:\a\1\s\**\*.sln'
So I made it as my code & the yaml file are in same branch. Now it will work, I hope it will help you.

RPM Build error: Too many levels of recursion in macro expansion. It is likely caused by recursive macro declaration

I have been trying to build a rpm using rpmbuild but I keep getting the following error-
error: Too many levels of recursion in macro expansion. It is likely caused by recursive macro declaration.
Environment Details-
rpmbuild --version
RPM version 4.11.3
part of .spec file-
############# we define product here ###################
%define name abc
%define installdir /direc
############### product Info ###################
Summary: ABC management package
Name: %{name}
Version: %{version}
Release: %{release}
Source: %{name}-%{version}.tgz
Vendor: XYZ
License: Commercial
Group: System Environment/Libraries
Prefix: %{_prefix}
Buildroot: %{_tmpbuildroot}
################Dependencies ###########################
Requires : %{name} = %{version}, mod_php, php-pgsql
.rpmmacros file
%_topdir /home/jan/rpmbuild/
%_tmppath /home/jan/rpmbuild/tmp
%_tmpbuildroot /home/jan/rpmbuild/build
%_buildroot /home/jan/rpmbuild/BUILD
%version 100.0.111.20200213
%release R_jenkins-XXXXXX-61
%extra_require ameyocrm = 100.0.111.20200213
Command used to build rpm -
sudo rpmbuild -bb -vv /home/jan/Work/BuildMachine/RPM/rpm_spec/rpm/SPECS/myspecfile.spec --target "\x86_64-redhat-linux\"
%name, %version and %release macros are in-built. You should not try to override them. The %name macro is defined as the content of the Name: tag, same goes for %version and %release.
Rewrite it to something like this:
Name: abc
Version: 100.0.111.20200213
Release: R_jenkins-XXXXXX-61
Source: %{name}-%{version}.tgz
...
EDIT: As noted by #Danila:
Requires : %{name} = %{version}
Means that your package requires itself, which makes no sense.
EDIT2
If you want to be able to define the version number and release from outside, you can just define another macro:
%{!?_version: %define _version 100.0.111.20200213 }
%{!?_release: %define _release R_jenkins-XXXXXX-61 }
Name: abc
Version: %{_version}
Release: %{_release}
these macros _version and _release are not standard and can be defined from outside your spec file.
try adding --define name <name> --define release <number> to the rpmbuild command.

how to compile Ignite application on CMake?

I did compile Ignite Application successfully.
but The Binary didn't work.
/tmp/tmp.Nw0IPD6ru3/cmake-build-debug-local-container/planet_engine: error while loading shared libraries: libjvm.so: cannot open shared object file: No such file or directory
how can I make to it work?
Also, I compiled C++ Examples successfully. such as ignite-compute-example.
and, I execute that but I got an error message.
An error occurred: JVM library is not found (did you set JAVA_HOME environment variable?)
and I using a nightly release version 2.8.0.20190213 because I couldn't build to version 2.7 in my environment.
I posted environment values down.
IGNITE_HOME=
TERM=xterm-256color
SHELL=/bin/bash
LIBRARY_PATH=/root/jre1.8.0_201/lib/amd64/server:/root/jre1.8.0_201/lib/amd64/
LC_NUMERIC=ko_KR.UTF-8
SSH_TTY=/dev/pts/0
JRE_HOME=/root/jre1.8.0_201
USER=root
LS_COLORS=rs=0:d...
LD_LIBRARY_PATH=/root/jre1.8.0_201/lib/amd64/server:/root/jre1.8.0_201/lib/amd64/
CLASS_PATH=/root/jdk-11.0.2/lib:
LC_TELEPHONE=ko_KR.UTF-8
MAIL=/var/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/jdk-11.0.2/bin
LC_IDENTIFICATION=ko_KR.UTF-8
JAVA_HOME=/root/jdk-11.0.2
LANG=en_US.UTF-8
LC_MEASUREMENT=ko_KR.UTF-8
JDK_HOME=/root/jdk-11.0.2/lib
SHLVL=1
HOME=/root
LOGNAME=root
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
LC_TIME=ko_KR.UTF-8
LC_NAME=ko_KR.UTF-8
_=/usr/bin/env
Thank you for reading. :)
I got it.
I am working on a docker container environment.
and therefore I am using remote build and debug with ssh and gdb.
finally, I found out why it couldn't find libjvm.so and why couldn't read environment values such as JAVA_HOME.
because it is working in gdb for now.
I confirmed that it is working when without gdb.
I will find a solution.
and, if I have been found, I will update the answer.
[Solved]
I share how I make solved that.
I was using an Oracle JDK-11 through source install.
but Ignite C++ client need something different with latest released jdk versions.
Ignite need a directory structure like this
JAVA_HOME/ (as JDK install directory)
- jre/
- lib/
- lib/
...
I solved by apt install openjdk-8-jdk.
openjdk-8-jdk have structure for what Ignite need.
i added JAVA_HOME, IGNITE_HOME, at /etc/environment.
It works finally.
but I got another problem. HAHA
I am so sad.
This also GDB problem..

Run a batch file from Inno Setup installer with Administrator privileges

If made a installer which requires a little script to restore a database and a user. This is a sqlcmd script and requires administrator rights.
But I can't get it working in the installer (runascurrentuser and/or PrivilegesRequired=admin). If I run it manually as administrator, it does work.
Code:
[Setup]
PrivilegesRequired=admin
[Run]
Filename: "{app}\DBenUser.cmd"; Components: DbenUser; Flags: runascurrentuser; StatusMsg: net 2 moveanduser wordt geinstaleerd even geduld...
I saw somethings about a registry is this the way to go?
Basicly this is little sqlcmd script to restore some db files and create a user.
CD\
Net stop MSSQL$NET2
Net stop Net2ClientSvc
MOVE /Y "C:\Program Files\IQ Soft\Net2_Data.MDF" "C:\Net2 Access Control\Net2_Data.MDF"
MOVE /Y "C:\Program Files\IQ Soft\Net2_Log.LDF" "C:\Net2 Access Control\Net2_Log.LDF"
MOVE /Y "C:\Program Files\IQ Soft\Net2Archive_Data.MDF" "C:\Net2 Access Control\Net2Archive_Data.MDF"
MOVE /Y "C:\Program Files\IQ Soft\Net2Archive_Log.LDF" "C:\Net2 Access Control\Net2Archive_Log.LDF"
MOVE /Y "C:\Program Files\IQ Soft\Net2Events_Data.MDF" "C:\Net2 Access Control\Net2Events_Data.MDF"
MOVE /Y "C:\Program Files\IQ Soft\Net2Events_Log.LDF" "C:\Net2 Access Control\Net2Events_Log.LDF"
Net stop MSSQL$NET2
Net stop Net2ClientSvc
Net start MSSQL$NET2 /m
SQLCMD -S localhost\net2 -Q "CREATE LOGIN b4tmm WITH PASSWORD='b4tmm'"
SQLCMD -S localhost\net2 -Q "SP_ADDSRVROLEMEMBER 'b4tmm', 'SYSADMIN'"
net stop MSSQL$NET2
net start MSSQL$NET2
net start Net2ClientSvc
These are all the things the sqlcmd file uses within innosetup (file is called DBenUser.cmd):
[Types]
Name: "Compleet"; Description: "IQ Soft Compleet"
Name: "Client"; Description: "IQ Soft Client"
[Components]
Name: "DbenUser"; Description: "DbenUser "; Types: Compleet;
[Files]
Filename: "{app}\DBenUser.cmd"; Components: DbenUser; Flags: runascurrentuser; StatusMsg: net 2 moveanduser wordt geinstaleerd even geduld...
[Eddited]
I tested the admin rights by unchecking all my components in innosetup except the sqlcmd script (and running it on a snapshot of vm ware where all the other programs where installed and only needed the script to compleet the installation). If i ran it as the first/only program im my installer it works (so admin rights are ok (also tested this by moving a file to a admin only folder with a cmd script). After that i tested the compleet installation again with all the other components active and it woudn't work. It seems like somehow the installer "loses" its admin rights after all the other components are installed. The cmd gives me the error: SQLCMD is not recognized as an internal or external command, program or batch file
SQLCMD -S localhost\net2 -Q "CREATE LOGIN b4tmm WITH PASSWORD='b4tmm'"
SQLCMD -S localhost\net2 -Q "SP_ADDSRVROLEMEMBER 'b4tmm', 'SYSADMIN'"
(The other components are .net 4,5, Paxton (net2), Sql manager 2012, Sql express 2012, Crystal reports , SQLCMD script in that order)
Anyone has any idea? Im clueless at this point
Additional information
[Files]
Source: "C:\Users\Chris V\Desktop\IQ-Soft\IQ-Soft.exe"; DestDir: "{app}"; Components: IQ_soft;
Source: "C:\Users\Chris V\Desktop\IQ-Soft\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\Chris V\Desktop\IQ-Soft\IQ-Soft Setup.exe"; DestDir: "{app}"; Components: IQ_Database
;----------------------------------------------------------------------------------------------------------------------------------------
Source: "C:\Users\Chris V\Desktop\Net4\dotNetFx45_Full_setup.exe"; DestDir: {tmp};
;----------------------------------------------------------------------------------------------------------------------------------------
;Source: "C:\Users\Chris V\Desktop\crystal reports\crystalreports.msi"; DestDir: {tmp}; Components: CrystalReports
;----------------------------------------------------------------------------------------------------------------------------------------
Source: "C:\Users\Chris V\Desktop\Paxton\SetupPaxton.exe"; DestDir: {tmp}; Components: Paxton;
;----------------------------------------------------------------------------------------------------------------------------------------
;Source: "C:\Users\Chris V\Desktop\Sdk\RedistOEM.msi"; DestDir: {tmp}; Components: Sdk;
;----------------------------------------------------------------------------------------------------------------------------------------
Source: "C:\Users\Chris V\Desktop\Sql expr\SQLEXPR.exe"; DestDir: {tmp}; Components: Sqlexpress;
Source: "C:\Users\Chris V\Desktop\Sql expr\SQLMANG.exe"; DestDir: {tmp}; Components: Sqlman;
;----------------------------------------------------------------------------------------------------------------------------------------
Source: "C:\Users\Chris V\Desktop\Net2\Net2Databaseschoon\*"; DestDir: "{app}"; Components: Net2DB;
;Source: "C:\Users\Chris V\Desktop\Net2\handleiding.odt"; DestDir: "{app}"; Components: Handleiding;
Source: "C:\Users\Chris V\Desktop\Net2\DBenUser.cmd"; DestDir: "{app}"; Components: DbenUser;
[Run]
Filename: {tmp}\dotNetFx45_Full_setup.exe; Parameters: "/q:a /c:""install /l /q"""; StatusMsg: Microsoft Framework 4.5 wordt geinstaleerd even geduld...
;-------------------------------------------------------------------------------------
Filename: {tmp}\SetupPaxton.exe;Components: Paxton; StatusMsg: Paxton wordt geinstaleerd even geduld...
;Filename: {tmp}\RedistOEM.msi;Components: Sdk; Flags: shellexec waituntilterminated; StatusMsg: Sdk wordt geinstaleerd even geduld...
;-------------------------------------------------------------------------------------
Filename: {tmp}\SQLMANG.exe;Components: Sqlman; StatusMsg: SQL Manager wordt geinstaleerd even geduld...
Filename: {tmp}\SQLEXPR.exe;Components: Sqlexpress; StatusMsg: Sql express wordt geinstaleerd even geduld...
;-------------------------------------------------------------------------------------
;Filename: {tmp}\crystalreports.msi;Components: CrystalReports; Flags: shellexec waituntilterminated ; StatusMsg: Crystal reports wordt geinstaleerd even geduld...
;-------------------------------------------------------------------------------------
Filename: "{app}\DBenUser.cmd"; Components: DbenUser; Flags: runascurrentuser; StatusMsg: net 2 moveanduser wordt geinstaleerd even geduld...
I have tried to create the simplest installer possible that installs a single .cmd file and runs it:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputDir=.
[Files]
Source: "test.cmd"; DestDir: {app}
[Run]
FileName: "{app}\test.cmd"; StatusMsg: "running cmd"
The test.cmd is like:
echo a > c:\admintestfile
dir c:\admintestfile
pause
I cannot write to c:\ without Administrator privileges.
As expected, the batch file succeeds, as it is run with Administrator privileges (as long as the installer itself is), as expected:
So there's probably something else, something specific about the batch file, that causes your problems.
In the script, you must include full path to the programs. E.g.
%WINDIR%\SYSTEM32\NET.exe
then it works.

Compiling Compass in an Ember-CLI project

I'm using ember-cli v0.0.23, and am trying to get the broccoli-compass package working with my project, and I've run into some problems.
First, in my Brocfile, I have replaced the standard Ember-CLI "blueprint" version of:
var styles = preprocessCss(appAndDependencies, prefix + '/styles', '/assets');
with the following:
var compileCompass = require('broccoli-compass');
var styles = compileCompass(appAndDependencies, 'app/styles/app.scss', {
outputStyle: 'expanded',
sassDir: 'app/styles',
imagesDir: 'public/images/'
});
However, when I run an ember build, I receive the following output:
$ ember build
[broccoli-compass] Error: Command failed: Errno::ENOENT on line ["155"] of /Library/Ruby/Gems/2.0.0/gems/compass-0.12.6/lib/compass/compiler.rb: No such file or directory - /Users/gaker/Sites/project/tmp/tree_merger-tmp_dest_dir-GrWa8Zva.tmp/app/styles/app.scss
Run with --trace to see the full backtrace. The command-line arguments was: `compass compile app/styles/app.scss --relative-assets --sass-dir app/styles --output-style expanded --images-dir public/images/ --css-dir "../compass_compiler-tmp_dest_dir-eFsq51BG.tmp"`
If I try to run the compass command that is output in the error in my terminal, it does create the file, only it is up one directory from my project root (notice --css-dir in the output).
I have tried many combinations of options sassDir, imagesDir, etc when calling compileCompass and this is the closest I've gotten.
So any ideas on what I can do to successfully get compass, broccoli-compass and ember-cli playing nicely?
Thanks in advance
You can use ember-cli-compass-compiler addon to compile compass in ember-cli apps.
Just do the following in your ember-cli app:
npm install --save-dev ember-cli-compass-compiler
This is all you need to do, everything works as expected from now on. It compiles your appname.scss file into appname.css on ember build or ember serve command.
Try this (added prefix and cssDir):
var compileCompass = require('broccoli-compass');
var styles = compileCompass(appAndDependencies, prefix + '/styles/app.scss', {
outputStyle: 'expanded',
sassDir: prefix + '/styles',
imagesDir: 'public/images/',
cssDir: '/assets'
});
Steffen