dawies
Posts: 40
Joined: Thu Jun 23, 2011 7:03 am

Select folder and copy file

Hi Guys,

I want to make this installer so that the user can select an advance option which displays a dialog to select a folder containing several config files. When this was selected the installer should delete the existing config file and copy another one from the selected folder into the APPDIR.

I have read the tutorials on "Display a dialog based on a checkbox state" and "How to browse for a folder at install time?" and "Select an external file during the installation" and am still not managing to get it to delete the old file or copy the new one to the APPDIR.

Please can you help.

regards,

Dawie
Attachments
BrowseConfigs.aip
(16.96 KiB) Downloaded 643 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Select folder and copy file

Hi Dawie,

In case the user will choose the file itself from the folder, you can implement the functionality from the "Select an external file during the installation" article onto a new project. You can download and modify the sample project if needed.
In the end, simply condition your file removal with AI_OFN_FILEPATH property. This way the file will be removed only when the user browses to the config file.

In case the user will just browse for the folder( doesn't know what file to choose ), after implementing and understanding the article, you can adapt it so that no matter what file the user chooses from that folder, the selected file will always be the one your application needs.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dawies
Posts: 40
Joined: Thu Jun 23, 2011 7:03 am

Re: Select folder and copy file

Hi there Mihai,

I understand the article but I do not want the user to select a file it is important that the user just selects the folder containing the files I want to use. It would not be very professional to let the user select just some random file :)

regards,

Dawie
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Select folder and copy file

Hi Dawie,

This article details how you can permit the user to choose a folder at install time and then store its path in a public property. The described scenario is a different one, but again you can adapt and combine it with the other functionality to achieve what you need.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dawies
Posts: 40
Joined: Thu Jun 23, 2011 7:03 am

Re: Select folder and copy file

Hi there Mihai,

I have read both of these tutorials. We've been going to a fro with this here: http://www.advancedinstaller.com/forums ... =2&t=19724 and in this thread for 2 days short of a month now. I have still not managed to accomplish what I need. I have now again tried using variations of the "Browse for folder" and "Browse for file" tutorials for umpteenth time and am not getting anywhere.
Please can you have a look at the project file and tell my what I'm doing wrong/not doing overlooking or overdoing. I've added the latest smallest attempt at this.

regards,

Dawie
Attachments
BrowseForFolder.aip
(12.49 KiB) Downloaded 642 times
dawies
Posts: 40
Joined: Thu Jun 23, 2011 7:03 am

Re: Select folder and copy file

:) I've managed to get it right thank you. :)
Radhika_Shankar
Posts: 9
Joined: Thu Oct 10, 2024 7:03 am

Re: Select folder and copy file

Hi Team,
I was trying to make a .exe installer for my application. I need few assistance ,pls help on below items
1.I need to create a windows service (P.s i have read all the tutorials, tried with services tab and also created powershell script to create a new service but nothing worked). will provide you the steps below we do for manual service creation of my application (this needs to be done inside Advance installer)

"C:\Program Files\Everi\JackpotXpressAPI\bin\nssm.exe" install EVERI-JackpotXpress-TaskRunner "C:\Program Files\Everi\JackpotXpressAPI\scripts\services\taskrunner.cmd"
this command will run in Command prompt window,

please find below the taskrunner.cmd file content (note: here i am just giving sample, when i tried all path as be given correctly)

@echo off
:top
"C:\Program Files\Everi\Sample\JXServices\bin\curl-7.76.1-win64-mingw\bin\curl.exe" --max-time 30 http://localhost/jx/taskrunner
timeout /t 15
goto top


2. I need to install (that is copy certain folders ) based on the checkbox clicked, ( have read this viewtopic.php?t=27903 tutorial but no luck i could not understand the thing - use "Go To Component" context menu option of your files to select the files components from "Organization" page ; because this doesn't there in my project)

Waiting for your response. I am using 22.0 Advance installer version
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Select folder and copy file

Hello Radhika and welcome to our forums,
1.I need to create a windows service (P.s i have read all the tutorials, tried with services tab and also created powershell script to create a new service but nothing worked). will provide you the steps below we do for manual service creation of my application (this needs to be done inside Advance installer)
Please note that your EXE must be specifically designed so it can run as a service - not all executables can run as a service.

There are some functions that your EXE needs to have so it can communicate with the Service Manager.

You can see those functions in the following tutorial:

Tutorial: Create a Windows service app
2. I need to install (that is copy certain folders ) based on the checkbox clicked, ( have read this viewtopic.php?t=27903 tutorial but no luck i could not understand the thing - use "Go To Component" context menu option of your files to select the files components from "Organization" page ; because this doesn't there in my project)
How to conditionally install a file or a registry

The above article should explain how to achieve what you need.

If you right click on a file --> from the menu you can select the "Go to Component" option.

Additionally, you can select a file and press F8 and that would do the same.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Radhika_Shankar
Posts: 9
Joined: Thu Oct 10, 2024 7:03 am

Re: Select folder and copy file

Thank you catalin for your response.

Actually from this tutorial https://www.advancedinstaller.com/user- ... ition.html , tells how to install files on conditions. But my requirement is i need to install "FOLDERS" on condition, pls tell how to achieve this. When i tried to right click on the folders icon, Go to component option remain disabled.

Awaiting for your reply:)
Attachments
install_folders_conditionally.png
install_folders_conditionally.png (196.29 KiB) Viewed 7071 times
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Select folder and copy file

Hello Radhika,

By default, a component is created for your folder.

However, if you add files to it, then the component will be removed and the components of the files will be added instead.

What we can do here is having all the file components all under a single feature and then condition that feature (it will condition the installation of all the files from the folder).

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Radhika_Shankar
Posts: 9
Joined: Thu Oct 10, 2024 7:03 am

Re: Select folder and copy file

Thank you so much, that works :)
Radhika_Shankar
Posts: 9
Joined: Thu Oct 10, 2024 7:03 am

Re: Select folder and copy file

One more help, can you pls assist with verbose logging.

I read the Advance installer articles and enabled verbose logging checkbox, after this msi log file is stored in temp location . Can you pls assist how to change this location. my requirement is to store the log file where the installations files installed that it (APPDIR)
Radhika_Shankar
Posts: 9
Joined: Thu Oct 10, 2024 7:03 am

Re: Select folder and copy file

Awaiting for your response, kindly assist me
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Select folder and copy file

Hello,
Thank you so much, that works :)
Glad to hear that worked.
I read the Advance installer articles and enabled verbose logging checkbox, after this msi log file is stored in temp location . Can you pls assist how to change this location. my requirement is to store the log file where the installations files installed that it (APPDIR)
I'm afraid that might not be possible, at least not with APPDIR, which is a folder that is created during the installation process.

The log file, on the other hand, is created at an earlier time.

Besides that, you can not control the location where the log is created using the "Enable verbose logging" option.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”