Hello,
is it just me, or is there no setuphelper for connecting a network drive?
It could be a useful function in some cases...
(I know you might not have time to do everything... I'll look into it).
Regards,
ET
[SOLVED] No setuphelper for network drive connection?
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Good morning,
No, this functionality is not available in setuphelpers; it can be done manually in the user context within the session_setup() function if desired
However, it should be noted that this piece of code will only be executed once per person per workstation, not at each startup.
If you wish to systematize network drives, you can do so more simply via Group Policy in Active Directory
If you ever wish to contribute to the WAPT source code with a "map_network_drive" function, that's also possible: https://github.com/tranquilit/WAPT/pulls
Alexander
No, this functionality is not available in setuphelpers; it can be done manually in the user context within the session_setup() function if desired
Code: Select all
def session_setup():
run(r'net use T: \\srvfichiers\partage\ /p:yes')
If you wish to systematize network drives, you can do so more simply via Group Policy in Active Directory
If you ever wish to contribute to the WAPT source code with a "map_network_drive" function, that's also possible: https://github.com/tranquilit/WAPT/pulls
Alexander
- dcardon
- WAPT Expert
- Messages: 1932
- Registration: June 18, 2014 - 09:58
- Location: Saint Sébastien sur Loire
- Contact :
Hello Etunilim
Sincerely,
Denis
Regarding this use case, I strongly advise against it. The WAPT package must be self-contained, because it's uncertain whether the network will be available when the installation starts (for example, if a waptexit command is executed when the machine shuts down on an 802.1x network with user authentication, the network will no longer be available at the time of installation). The self-contained nature of WAPT makes it more deterministic than other deployment solutions.
Sincerely,
Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
I had started with powershell to mount the network drive (I'm trying to completely abandon cmd and switch to ps systematically), hence the idea of making a setup_helper: we use an internal software repository, which we often have to connect to, I didn't want to retype all the lines each time.
But because it takes up a line at the bottom, it does seem much less useful!
Just a quick note for those who might try it, to avoid tearing their hair out over escaped or unescaped backslashes that cause errors, here's a type of syntax that works:
Of course, this drive should only contain free software, and access using the command credentials should be read-only. Do not, under any circumstances, do this with a drive containing sensitive data or licensed logs, and/or credentials that grant write access!
But because it takes up a line at the bottom, it does seem much less useful!
Just a quick note for those who might try it, to avoid tearing their hair out over escaped or unescaped backslashes that cause errors, here's a type of syntax that works:
Code: Select all
logservURL = r'\\mon.serveur.domain.fr\freeLogs$'
run('net use %s /user:user passwd' % logservURL)
run('call %s\Gimp\silent.cmd' % logservURL)
Reply to dcardon:
Well aware of that.
That said, software that doesn't install on the first try will install on the next reboot (not to mention that if we notice errors in the console, we can force the installation immediately).
This method allows us to base the installation/update of open-source software on a series of centrally maintained scripts, which are used by all the deployment tools we use (depending on the sector, context, machine type, etc.): WAPT, GPO, SCCM, and even new tools we might decide to use in the future.
Our (open-source) software repository is maintained in a single location and is independent of the tool used to deploy it.
AND
Well aware of that.
That said, software that doesn't install on the first try will install on the next reboot (not to mention that if we notice errors in the console, we can force the installation immediately).
This method allows us to base the installation/update of open-source software on a series of centrally maintained scripts, which are used by all the deployment tools we use (depending on the sector, context, machine type, etc.): WAPT, GPO, SCCM, and even new tools we might decide to use in the future.
Our (open-source) software repository is maintained in a single location and is independent of the tool used to deploy it.
AND
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
Just FYI and to avoid problems (from experience):
It's best to copy the binary and the script before installation in this case. If the network connection drops during installation, it can completely crash the software. You also lose the advantage of an installation that works even when the server is unavailable (e.g., on a laptop)
Also, be aware of network congestion! When the binary is in wapt, wapt will download it over time as workstations restart, thus "smoothing" the downloads. If you have an Office installation (500MB) to install on 1000 machines and all the machines shut down simultaneously, the file server must be able to distribute 500GB of the installation at once.
And the last problem is a security issue: if a binary is called from outside the package, then it is not included in the checksum, and therefore the package signature becomes useless...
